Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
nodesecurity-npm-utils
Advanced tools
Readme
Return the full package document for the given module
.
Get a depTree 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
.
var fs = require('fs');
getShrinkwrapDependencies(JSON.parse(fs.readFileSync('./npm-shrinkwrap.json')), function (err, depTree) {
console.log(depTree);
});
The 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
.
Note that the root module has a key too.
e.g.:
//depTree for some-module version 1.1.0
{
//root module
"some-module@1.1.0": {
parents: [],
children: ["depA@0.1.0", "depB@1.0.1", "depC@0.2.0"],
},
//root's dependencies
"depA@0.1.0": {
parents: ["some-module@1.1.0"],
children: ["underscore@1.6.0"],
source: "npm"
},
"depB@1.0.1": {
parents: ["some-module@1.1.0"],
children: ["underscore@1.6.0", "backbone@1.0.0"],
source: "npm"
},
"depC@0.2.0": {
parents: ["some-module@1.1.0"],
children: [],
source: "unknown" //not on npm, maybe it's private/local?
}
//deeper dependencies
"underscore@1.6.0": {
parents: ["depA@0.1.0", "depB@1.0.1", "backbone@1.6.0"], //modules can be required multiple places in the tree
children: [],
source: "npm"
},
"backbone@1.6.0": {
parents: ["depB@1.0.1"], //modules can be required multiple places in the tree
children: ["underscore@1.6.0"],
source: "npm"
}
}
FAQs
## Methods:
The npm package nodesecurity-npm-utils receives a total of 19,098 weekly downloads. As such, nodesecurity-npm-utils popularity was classified as popular.
We found that nodesecurity-npm-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.