Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
mr-dep-walk
Advanced tools
[![Build Status](https://travis-ci.org/stefanpenner/mr-dep-walk.svg?branch=master)](https://travis-ci.org/stefanpenner/mr-dep-walk) [![Build status](https://ci.appveyor.com/api/projects/status/ybwgahl64faf0507?svg=true)](https://ci.appveyor.com/project/em
This library extracts dependent files from both ES6 module syntax, and AMD module syntax;
yarn add mr-dep-walk
const {
depFilesFromFile,
depsFromFile,
depsFromSource,
depsFromAST
} = require('mr-dep-walk');
For depFilesFromFile
given an entry file, it will produce a list of all dependent files (recursively):
// file.js
import x from 'y';
// y.js
depFilesFromFile({
entry: 'file.js',
/* cwd: optional, */
/* parse: optional, */
}); // => 'y.js';
For depsFromFile
given a file, it will produce a list of its immediate dependent moduleNames;
// file.js
import x from 'y';
// y.js
depsFromFile({
entry: 'file.js',
/* cwd: optional, */
/* parse: optional, */
}); // => 'y';
For depsFromSource
given the raw source, it will produce a list of its immediate dependent moduleNames;
depsFromSource(`import x from 'y'`/*, options */); // => 'y'
For depsFromAST
given the AST, it will produce a list of its immediate dependent moduleNames;
depsFromSource(acorn.parse(`import x from 'y'`, {
ecmaVersion: 8,
sourceType: 'module'
})); // => 'y'
By default mr-dep-walk will use:
source => acorn.parse(source, { ecmaVersion: 8, sourceType: 'module'})
But some methods (depFilesFromFile
, depsFromFile
, depsFromSource
) support
an alt-parser, example:
depFilesFromFile('some-file.js', {
entry: 'foo.js',
parse(source) {
return customParser(source);
},
});
FAQs
[![Build Status](https://travis-ci.org/stefanpenner/mr-dep-walk.svg?branch=master)](https://travis-ci.org/stefanpenner/mr-dep-walk) [![Build status](https://ci.appveyor.com/api/projects/status/ybwgahl64faf0507?svg=true)](https://ci.appveyor.com/project/em
The npm package mr-dep-walk receives a total of 7,681 weekly downloads. As such, mr-dep-walk popularity was classified as popular.
We found that mr-dep-walk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.