{"_id":"requiresafe-npm-utils","_rev":"93044","name":"requiresafe-npm-utils","description":"[![Build Status](https://magnum.travis-ci.com/requiresafe/npm-utils.svg?token=y6kXcG28kZTEjJL8fnHQ)](https://magnum.travis-ci.com/requiresafe/npm-utils)","dist-tags":{"latest":"2.5.3"},"maintainers":[{"name":"nlf","email":""}],"time":{"modified":"2021-06-03T10:30:52.000Z","created":"2015-10-19T21:01:29.129Z","2.5.3":"2015-10-19T21:01:29.129Z"},"users":{},"author":{"name":"^lift security"},"repository":{"type":"git","url":"git+https://github.com/requiresafe/npm-utils.git"},"versions":{"2.5.3":{"name":"requiresafe-npm-utils","version":"2.5.3","author":{"name":"^lift security"},"repository":{"type":"git","url":"git+https://github.com/requiresafe/npm-utils.git"},"bin":{"rnpm":"bin/rnpm"},"dependencies":{"async":"^1.2.1","lodash":"^3.7.0","semver":"^5.0.3","silent-npm-registry-client":"1.0.0"},"devDependencies":{"jshint":"^2.7.0","precommit-hook":"^3.0.0","tape":"^4.0.0","tape-suite":"^0.2.1","underscore":"^1.8.3"},"keywords":["requireSafe","security","npm","package","shrinkwrap"],"license":"ISC","main":"index.js","scripts":{"test":"tape test/*"},"gitHead":"fb5114c6f866b45e73983bc168d77166ef170ae5","description":"[![Build Status](https://magnum.travis-ci.com/requiresafe/npm-utils.svg?token=y6kXcG28kZTEjJL8fnHQ)](https://magnum.travis-ci.com/requiresafe/npm-utils)","bugs":{"url":"https://github.com/requiresafe/npm-utils/issues"},"homepage":"https://github.com/requiresafe/npm-utils#readme","_id":"requiresafe-npm-utils@2.5.3","_shasum":"79111670bc1f5129f3c6282e456f0c04d2649bab","_from":".","_npmVersion":"3.3.6","_nodeVersion":"4.1.1","_npmUser":{"name":"nlf","email":"quitlahok@gmail.com"},"dist":{"shasum":"79111670bc1f5129f3c6282e456f0c04d2649bab","size":4238,"noattachment":false,"key":"/requiresafe-npm-utils/-/requiresafe-npm-utils-2.5.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/requiresafe-npm-utils/download/requiresafe-npm-utils-2.5.3.tgz"},"maintainers":[{"name":"nlf","email":""}],"directories":{},"publish_time":1445288489129,"_cnpm_publish_time":1445288489129,"_hasShrinkwrap":false}},"readme":"# requireSafe (+) npm utilities\n\n[![Build Status](https://magnum.travis-ci.com/requiresafe/npm-utils.svg?token=y6kXcG28kZTEjJL8fnHQ)](https://magnum.travis-ci.com/requiresafe/npm-utils)\n\n## Methods:\n\n### getModuleDependencies = function (module, callback)\n\nGet a [depTree](#deptree-format) for the given module. `module` is an object that must contain a name and may optionally contain a version.\n\n```js\ngetModuleDependencies({\n    name: 'helmet',\n    version: '0.2.0' //may also be a semver string, a la \"^1.1.0\"\n}, function (err, depTree) {\n    console.log(depTree);\n});\n```\n\n### getPackageDependencies = function (packageJson, callback)\n\nGet a [depTree](#deptree-format) for the module from a full package.json. `packageJson` should be an object from a parsed package.json file (or look like one): required keys: `name`, `version`, `dependencies`.\n\n```js\nvar fs = require('fs');\n\ngetPackageDependencies(JSON.parse(fs.readFileSync('./package.json')), function (err, depTree) {\n    console.log(depTree);\n});\n```\n\n### getModuleMaintainers = function (module, callback)\n\nGet an array of maintainers from a specifc module / version.\n\n## depTree format\n\nMany of the functions return a `depTree` representing the full dependency tree. This 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","_attachments":{},"homepage":"https://github.com/requiresafe/npm-utils#readme","bugs":{"url":"https://github.com/requiresafe/npm-utils/issues"},"license":"ISC"}