toolbag-plugin-nsp-check
v1.0.0
Published
toolbag plugin that checks your dependencies against the Node Security Project
Downloads
9
Maintainers
Readme
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-check
command must be explicitly invoked. Defaults totrue
.packagePath
(string) - Thepackage.json
file to check. Defaults topackage.json
inprocess.cwd()
. This value is passed directly to thensp
module.shrinkwrapPath
(string) - Thenpm-shrinkwrap.json
file to check. Defaults tonpm-shrinkwrap.json
inprocess.cwd()
. This value is passed directly to thensp
module.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 thensp
default 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')
}
}
]
});
};