Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
dependencies-hierarchy
Advanced tools
Creates a dependencies hierarchy for a symlinked `node_modules`
A symlinked node_modules
is created when installing using pnpm.
Install it via npm.
npm install dependencies-hierarchy
'use strict'
const hierarchyForPackages = require('dependencies-hierarchy').forPackages
hierarchyForPackages(['graceful-fs', {name: 'pify', range: '2'}], __dirname, {depth: 2})
.then(tree => {
console.log(JSON.stringify(tree, null, 2))
//> [
// {
// "pkg": {
// "name": "write-pkg",
// "version": "3.1.0",
// "path": "registry.npmjs.org/write-pkg/3.1.0"
// },
// "dependencies": [
// {
// "pkg": {
// "name": "write-json-file",
// "version": "2.2.0",
// "path": "registry.npmjs.org/write-json-file/2.2.0"
// },
// "dependencies": [
// {
// "pkg": {
// "name": "graceful-fs",
// "version": "4.1.11",
// "path": "registry.npmjs.org/graceful-fs/4.1.11"
// },
// "searched": true
// },
// {
// "pkg": {
// "name": "pify",
// "version": "2.3.0",
// "path": "registry.npmjs.org/pify/2.3.0"
// },
// "searched": true
// }
// ]
// }
// ]
// }
// ]
})
dependenciesHierarchy(projectPath, [opts]): Promise<Hierarchy>
Creates a dependency tree for a project's node_modules
.
projectPath
- String - The path to the project.[opts.depth]
- Number - 0 by default. How deep should the node_modules
be analyzed.[opts.only]
- 'dev' | 'prod' - Optional. If set to dev
, then only packages from devDependencies
are analyzed.
If set to prod
, then only packages from dependencies
are analyzed.forPackages(packageSelectors, projectPath, [opts]): Promise<Hierarchy>
Creates a dependency tree for a project's node_modules
. Limits the results to only the paths to the packages named.
packageSelectors
- (string | {name: string, version: string})[] - An array that consist of package names or package names and version ranges.
E.g. ['foo', {name: 'bar', version: '^2.0.0'}]
.projectPath
- String - The path to the project[opts.depth]
- Number - 0 by default. How deep should the node_modules
be analyzed.[opts.only]
- 'dev' | 'prod' - Optional. If set to dev
, then only packages from devDependencies
are analyzed.
If set to prod
, then only packages from dependencies
are analyzed.FAQs
Creates a dependencies hierarchy for a symlinked `node_modules`
The npm package dependencies-hierarchy receives a total of 33 weekly downloads. As such, dependencies-hierarchy popularity was classified as not popular.
We found that dependencies-hierarchy 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.