
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
Plugin for debugging your base application.
Install with npm:
$ npm i base-debug --save
To test-drive the plugin, add this to example.js (or just use the examples/example.js file in this project):
var debug = require('base-debug');
var Base = require('base');
var base = new Base();
base.use(debug('foo'));
var one = base.debug('one');
var two = base.debug('two');
one('this is one!');
two('this is two!');
Then, in the command line:
DEBUG=base:* node exampleDEBUG=base:one node example(See the debug docs for more information about using debug on all platforms.)
Namespace
Inside your plugin, register the debug() plugin, passing the name of your plugin as the "namespace" to use:
// given you have a plugin named `base-foo`
function baseFoo(options) {
return function(app) {
app.use(debug('foo'));
// then call the `app.debug` method
var debug = app.debug();
// then use it like this:
debug('yelling abc: %s', 'ABC!');
debug('yelling xyz: %s', 'XYZ!');
}
}
When your plugin is registered, like this:
// Add your plugin
var base = new Base();
base.use(baseFoo());
and the DEBUG=base:foo command is used, you should see something like this in the terminal:
(See the debug docs for more information about using debug on all platforms.)
Sub-namespaces
Optionally use "sub-namespaces":
function baseFoo(options) {
return function(app) {
app.use(debug('foo'));
// namespace `foo:one`
var one = app.debug('one');
// namespace `foo:two`
var two = app.debug('two');
// then use it like this:
one('yelling abc: %s', 'ABC!');
two('yelling xyz: %s', 'XYZ!');
}
}
When your plugin is registered, like this:
// Add your plugin
var base = new Base();
base.use(baseFoo());
and the following commands are used:
DEBUG=base:foo:*, orDEBUG=base:foo:one, orDEBUG=base:foo:twoYou should see something like this in the terminal:
(See the debug docs for more information about using debug on all platforms.)
You might also be interested in these projects:
option, enable and disable. See the readme… more | homepageInstall dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb on January 23, 2016.
FAQs
Plugin for debugging your base application.
We found that base-debug demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.