🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

nanodebug

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanodebug

A tiny, zero overhead debugging utility

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

nanodebug

A tiny, zero overhead debugging utility.

Installation

npm install nanodebug

Usage

By default, nanodebug is completely noop:

const debug = require('nanodebug')()

// Does nothing!
debug('You encountered a %s!', '🐛')

// Also does nothing!
debug(() => { debug('It accepts functions as well') })

// This... does nothing!
await debug(async () => { debug('They can even be async!') })

Go ahead and put some debugs in your code and enable nanodebug when :bug: hits the fan:

const debug = require('nanodebug')({ enabled: true })

By default, debug will log to stderr using console.error, which is also why we were able to specify a formatting string in the examples above. To change this, pass a log function in the options:

const debug = require('nanodebug')({ log: console.log.bind(console) })

Now, debug will instead log to stdout using console.log.

License

ISC

FAQs

Package last updated on 29 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts