Skip to content
A beaver



There are two methods provided:


Determines whether debugging is allowed

For example;

import { AllowDebug } from 'debark';

if (AllowDebug()) console.log('I am allowed to log');


Prevents console logging unless specifically requested

For example;

import { StripLogs } from 'debark';


How it works

The StripLogs method uses the AllowDebug method under the hood.

AllowDebug expects a DEBUG value in the process.envs. If one is not found, or exists and is any value other than true (BOOLEAN) or true (String), AllowDebug returns false and all logs are nooped.

How to run your application with debugging switched "on"

DEBUG=true npm start

Cover image courtesy of Tim Umphreys.


In almost all cases, the comments section is a vile cesspool of Reply Guys, racists, and bots.

I don't want to have to deal with that kind of hell so I don't have a comments section.

If you want to continue the conversation, you can always hit me up on Mastodon (which is not a vile cesspool of Reply Guys, racists, and bots).

Thomas Rigby

Thomas Rigby

When I'm not building things for the internet, I take photos of stuff.

Pronouns: he/him/his

Last played

Burn the Bitch

Ulver || Svidd Neger

Loading Invisible Visible RSS Navigation Close Arrow Info Online Online