1.0.0 • Published 9 years ago
toolbag-plugin-nsp-check v1.0.0
toolbag-plugin-nsp-check
Toolbag plugin that checks your dependencies against the Node Security Project's known vulnerabilities database. Checks against the NSP API can be made at startup time, or at any point during runtime via the toolbag command nsp-check.
Supported Parameters
checkOnRegister(boolean) - Iftrue, the NSP API is checked on plugin registration. Otherwise, thensp-checkcommand must be explicitly invoked. Defaults totrue.packagePath(string) - Thepackage.jsonfile to check. Defaults topackage.jsoninprocess.cwd(). This value is passed directly to thenspmodule.shrinkwrapPath(string) - Thenpm-shrinkwrap.jsonfile to check. Defaults tonpm-shrinkwrap.jsoninprocess.cwd(). This value is passed directly to thenspmodule.formatter(string or function) - If this is a string, it can be any formatter supported bynsp('json','summary', etc.). If this is a function, it will be used to format NSP API output. Defaults to thenspdefault format.
Example Configuration
Add toolbag-plugin-nsp-check to your package.json. Configure the plugin in .toolbagrc.js as shown below.
'use strict';
const NspCheck = require('toolbag-plugin-nsp-check');
const Path = require('path');
module.exports = function config (defaults, callback) {
callback(null, {
plugins: [
{
plugin: NspCheck,
options: {
checkOnRegister: true,
packagePath: Path.join(process.cwd(), 'package.json')
}
}
]
});
};