{"_id":"nsp-api","_rev":"92975","name":"nsp-api","description":"Node.js module wrapper for the Node Security Project API","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"time":{"modified":"2021-06-03T10:30:50.000Z","created":"2014-09-12T15:14:43.266Z","1.0.3":"2015-01-20T17:53:30.202Z","1.0.2":"2014-09-21T07:45:53.777Z","1.0.0":"2014-09-12T15:14:43.266Z"},"users":{"daviddias":true},"author":{"name":"Node Security Project"},"repository":{"type":"git","url":"git@github.com:nodesecurity/nsp-api.git"},"versions":{"1.0.3":{"name":"nsp-api","version":"1.0.3","description":"Node.js module wrapper for the Node Security Project API","main":"src/index.js","scripts":{"codestyle":"jscs src/index.js tests/*.js","lint":"jshint .","test":"node ./node_modules/.bin/lab -r tap tests/test.js | ./node_modules/.bin/tap-spec","test-cov":"node ./node_modules/.bin/lab -t 100 tests/test.js"},"precommit":["codestyle","lint","test","test-cov"],"repository":{"type":"git","url":"git@github.com:nodesecurity/nsp-api.git"},"keywords":["nsp","node","security","api","lib","client","module","wrapper","validate","shrinkwrap","package"],"author":{"name":"Node Security Project"},"license":"MIT","bugs":{"url":"https://github.com/nodesecurity/nsp-api/issues"},"homepage":"https://github.com/nodesecurity/nsp-api","dependencies":{"request":"^2.42.0"},"devDependencies":{"jscs":"^1.10.0","jshint":"^2.5.11","lab":"^4.4.4","precommit-hook":"^1.0.7","tap-spec":"^2.2.0"},"gitHead":"41f8cff89d8de70e7ff674f6f7ac202e9fff49ee","_id":"nsp-api@1.0.3","_shasum":"08790a75eb4f2cb0569c2ee29661e089feb51508","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.10.33","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"08790a75eb4f2cb0569c2ee29661e089feb51508","size":3399,"noattachment":false,"key":"/nsp-api/-/nsp-api-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/nsp-api/download/nsp-api-1.0.3.tgz"},"directories":{},"publish_time":1421776410202,"_cnpm_publish_time":1421776410202,"_hasShrinkwrap":false},"1.0.2":{"name":"nsp-api","version":"1.0.2","description":"Node.js module wrapper for the Node Security Project API","main":"index.js","scripts":{"test":"make test-cov"},"repository":{"type":"git","url":"git@github.com:nodesecurity/nsp-api.git"},"keywords":["nsp","node","security","api","lib","client","module","wrapper","validate","shrinkwrap","package"],"author":{"name":"Node Security Project"},"license":"MIT","bugs":{"url":"https://github.com/nodesecurity/nsp-api/issues"},"homepage":"https://github.com/nodesecurity/nsp-api","dependencies":{"request":"^2.42.0"},"devDependencies":{"lab":"^4.4.4","precommit-hook":"^1.0.7"},"gitHead":"459ad7f348c04fe365c80f659f70f1e2a685d716","_id":"nsp-api@1.0.2","_shasum":"2bd70494835558518a6a37281e474d2385dc7201","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"2bd70494835558518a6a37281e474d2385dc7201","size":3153,"noattachment":false,"key":"/nsp-api/-/nsp-api-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/nsp-api/download/nsp-api-1.0.2.tgz"},"directories":{},"publish_time":1411285553777,"_cnpm_publish_time":1411285553777,"_hasShrinkwrap":false},"1.0.0":{"name":"nsp-api","version":"1.0.0","description":"Node.js module wrapper for the Node Security Project API","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 0"},"repository":{"type":"git","url":"git@github.com:nodesecurity/nsp-api.git"},"keywords":["nsp","node","security","api","lib","client","module","wrapper","validate","shrinkwrap","package"],"author":{"name":"Node Security Project"},"license":"MIT","bugs":{"url":"https://github.com/nodesecurity/nsp-api/issues"},"homepage":"https://github.com/nodesecurity/nsp-api","dependencies":{"request":"^2.42.0"},"devDependencies":{"precommit-hook":"^1.0.7"},"gitHead":"e5409b8c5ba2a9a18823542c0bb8119ee8dc9c74","_id":"nsp-api@1.0.0","_shasum":"385053bc19d93dcde4d57fc2e7a484ded501ad46","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"385053bc19d93dcde4d57fc2e7a484ded501ad46","size":2483,"noattachment":false,"key":"/nsp-api/-/nsp-api-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nsp-api/download/nsp-api-1.0.0.tgz"},"directories":{},"publish_time":1410534883266,"_cnpm_publish_time":1410534883266,"_hasShrinkwrap":false}},"readme":"# nsp-api\n\n`nsp-api` is a simple node wrapper for the Node Security Project API.\n\n## Badgers\n\n[![NPM](https://nodei.co/npm/nsp-api.png?downloads=true&stars=true)](https://nodei.co/npm/nsp-api/)\n\n[![Build Status](https://travis-ci.org/nodesecurity/nsp-api.svg?branch=master)](https://travis-ci.org/nodesecurity/nsp-api)[![Dependency Status](https://david-dm.org/nodesecurity/nsp-api.svg)](https://david-dm.org/nodesecurity/nsp-api)![Codecov](https://img.shields.io/codecov/c/github/codecov/example-python.svg)[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/nodesecurity/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n## Usage\n\n```\n// require it as a normal node.js module\nvar nspAPI = require('nsp-api');\n\n// validate a module against Node Security Project database\nnspAPI.validateModule(module, version, function (err, results){..});\n\n// validate a full shrinkwrap against Node Security Project database\nnspAPI.validateShrinkwrap(shrinkwrap, function (err, results){..});\n```\n\n### `validateModule(module, version, callback)`\n\nRetrieve known vulnerabilities for a module from the NSP API.\n- `module` a string containing the modules name.\n- `version` a string containing the modules version.\n- `callback` callback function using the signature `function (err, results)` where:\n    - `err` An error generated from the underlying request.\n    - `results` An array containing any vulnerabilities.\n\n### `validateShrinkwrap(shrinkwrap, callback)`\nRetrieve known vulnerabilities from dependencies in a npm-shrinkwrap object from the NSP API.\n- `shrinkwrap` an object generated by parsing a npm-shrinkwrap.json file.\n- `callback` callback function using the signature `function (err, results)` where:\n    - `err` An error generated from the underlying request.\n    - `results` An array containing any vulnerabilities.\n\n## Example\n\n```\nvar nspAPI = require('nsp-api');\n\nnspAPI.validateModule('tunnel-agent', '0.4.0', function(err, results) {\n    console.log(results);\n    // undefined // (no vulnerabilities that we know, yet)\n});\n\nnspAPI.validateModule('yar', '0.1.0', function(err, results) {\n    console.log(results);\n    // [{\n    //    title: 'Yar Denial-of-Service',\n    //    author: 'Reid Burke',\n    //    module_name: 'yar',\n    //    publish_date: 'Mon Jun 16 2014 12:29:10 GMT-0700 (PDT)',\n    //    cves: [ [Object] ],\n    //    vulnerable_versions: '<2.2.0',\n    //    patched_versions: '>=2.2.0',\n    //    url: 'yar-DoS'\n    // }]\n});\n\n```\n","_attachments":{},"homepage":"https://github.com/nodesecurity/nsp-api","bugs":{"url":"https://github.com/nodesecurity/nsp-api/issues"},"license":"MIT"}