New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

debug-filename

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-filename

A wrapper around the debug module, providing the additional ability to determine the calling file name for debug's namespace. Get automatic unique namespaces each time you use debug!

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

debug-filename

A wrapper around the debug module, providing the additional ability to determine the calling file name for debug's namespace. Get automatic unique namespaces each time you use debug!

Install

npm i debug-filename

Configuration

DEBUG_FILENAME_PREFIX : <string>

Namespace prefix, Default value is app .

DEBUG_FILENAME_START : <string>

The directory hierarchy at the beginning of the namespace, Default value is 0 .

DEBUG_FILENAME_LENGTH : <string>

The number of directory hierarchies the namespace contains, Default value is 0 .

Quick Examples

Basic usage

// test/foo.js
import debug from 'debug-filename';

// DEBUG can be triggered by the following format:
// - DEBUG=app:test:foo
// - DEBUG=app:test:*
// - DEBUG=app:*
// - DEBUG=*
debug('logging data'); // "app:test:foo logging data"

Advanced usage

  • Modify App name

    // test/foo.js
    import debug from 'debug-filename';
    
    // DEBUG_FILENAME_PREFIX=Application DEBUG=Application:test:foo
    debug('logging data'); // "Application:test:foo logging data"
    
  • Stripped off the first layer of the catalog

    // test/foo.js
    import debug from 'debug-filename';
    
    // DEBUG_FILENAME_START=1 DEBUG=app:foo
    debug('logging data'); // "app:foo logging data"
    
  • Specify the length of the namespace

    // test/a/b/c/d.js
    import debug from 'debug-filename';
    
    // DEBUG_FILENAME_LENGTH=2 DEBUG=app:test:a
    debug('logging data'); // "app:test:a logging data"
    

FAQs

Package last updated on 05 Aug 2019

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