{"name":"nodesecurity-npm-utils","version":"3.0.0","author":{"name":"^lift security"},"dependencies":{"semver":"^5.0.3","silent-npm-registry-client":"1.0.0"},"devDependencies":{"eslint":"^1.8.0","eslint-config-nodesecurity":"^1.0.0","git-validate":"^2.1.0"},"keywords":["npm","package","nsp","security","shrinkwrap"],"license":"MIT","main":"index.js","pre-commit":["lint"],"repository":{"type":"git","url":"https://github.com/nodesecurity/npm-utils.git"},"scripts":{"lint":"eslint ."},"readme":"# node security project npm utilities\n\n## Methods:\n\n### getPackageJson = function (module, callback)\n\nReturn the full package document for the given `module`.\n\n### getShrinkwrapDependencies = function (shrinkwrapJson, callback)\n\nGet a [depTree](#deptree-format) for the module from a full npm-shrinkwrap.json. `shrinkwrapJson` should be an object from a parsed npm-shrinkwrap.json file (or look like one): required keys: `name`, `version`, `dependencies`.\n\n```js\nvar fs = require('fs');\n\ngetShrinkwrapDependencies(JSON.parse(fs.readFileSync('./npm-shrinkwrap.json')), function (err, depTree) {\n    console.log(depTree);\n});\n```\n\n#### depTree format\n\nThe returned `depTree` representing the full dependency tree object is in a format that's easier to traverse than a full tree. Each module in the full heirarchy has a key in the object of `module@version`. It's value is an object with `parents`, `children` and `source`.\n\nNote that the root module has a key too.\n\ne.g.:\n\n```js\n//depTree for some-module version 1.1.0\n{\n    //root module\n    \"some-module@1.1.0\": {\n        parents: [],\n        children: [\"depA@0.1.0\", \"depB@1.0.1\", \"depC@0.2.0\"],\n    },\n\n    //root's dependencies\n    \"depA@0.1.0\": {\n        parents: [\"some-module@1.1.0\"],\n        children: [\"underscore@1.6.0\"],\n        source: \"npm\"\n    },\n    \"depB@1.0.1\": {\n        parents: [\"some-module@1.1.0\"],\n        children: [\"underscore@1.6.0\", \"backbone@1.0.0\"],\n        source: \"npm\"\n    },\n    \"depC@0.2.0\": {\n        parents: [\"some-module@1.1.0\"],\n        children: [],\n        source: \"unknown\" //not on npm, maybe it's private/local?\n    }\n\n    //deeper dependencies\n    \"underscore@1.6.0\": {\n        parents: [\"depA@0.1.0\", \"depB@1.0.1\", \"backbone@1.6.0\"], //modules can be required multiple places in the tree\n        children: [],\n        source: \"npm\"\n    },\n    \"backbone@1.6.0\": {\n        parents: [\"depB@1.0.1\"], //modules can be required multiple places in the tree\n        children: [\"underscore@1.6.0\"],\n        source: \"npm\"\n    }\n}\n```\n","readmeFilename":"README.md","description":"## Methods:","bugs":{"url":"https://github.com/nodesecurity/npm-utils/issues"},"homepage":"https://github.com/nodesecurity/npm-utils","_id":"nodesecurity-npm-utils@3.0.0","_shasum":"71fea52a8c9a1cd42b78c54a64c0931dfa19341f","_from":"https://registry.npmjs.org/nodesecurity-npm-utils/-/nodesecurity-npm-utils-3.0.0.tgz","_resolved":"https://registry.npmjs.org/nodesecurity-npm-utils/-/nodesecurity-npm-utils-3.0.0.tgz"}