Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including nsp-audit-shrinkwrap with all npm packages installed. Try it out:

var nspAuditShrinkwrap = require("nsp-audit-shrinkwrap")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nsp-audit-shrinkwrap v1.0.3

audits a shrinkwrap file or a stream of shrinkwraps agains the Node Security Project module vulnerability database

nsp-audit-shrinkwrap

nsp-audit-shrinkwrap offers a simple library to audit your shrinkwrap or a stream of shrinkwraps.

Badgers

NPM

Dependency Status![Gitter](https://badges.gitter.im/Join Chat.svg)

Single npm-shrinkwrap.json

var nspShrinkwrap  = require('nsp-audit-shrinkwrap');
var shrinkwrapPath = '/path/to/npm-shrinkwrap.json'
var shrinkwrapFile = fs.readFileSync(shrinkwrapPath);


nspShrinkwrap.audit(shrinkwrapFile, function (err, results){
    console.log(results);
};

nspShrinkwrap.auditByPath(shrinkwrapPath, function (err, results){
    console.log(results);
};

Stream of npm-shrinkwrap.json

var auditStream = nspShrinkwrap.auditStream();
var results = [];

auditStream.shrinkwrap.write(shrinkwrap1);
auditStream.shrinkwrap.write(shrinkwrap2);
//... how many shrinkwraps you want

setTimeout(function(){
    auditStream.shrinkwrap.end(); // you close the stream whenever you want :)
}, 3000);

auditStream.results.on('_data', function (data){
    results.push(data);
});

auditStream.results.on('_end', function (){
    console.log(results);
});
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free