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.
require()
all files in subfolder.
This will pre-load all files with require, and build an object.
For instance, given this tree:
├── 1.js
├── 2.js
├── 3
│ ├── 31.js
│ └── 32
│ └── 321.js
└── with-dash.js
Calling autoload(__dirname)
will give:
{
'1': exportsFromFile,
'2': exportsFromFile,
'withDash': exportsFromFile,
'3': {
'31': exportsFromFile,
'32': {
'321': exportsFromFile
}
}
}
Where exportsFromFile
is the value returned by the file module.exports
.
Non js or json files are not loaded.
You can load the files with two types of paths:
autoload(__dirname);
autoload(__dirname + '/directory')
// will load /username/projectname/directory
autoload('directory');
FAQs
Require all files in subfolders
We found that auto-load demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.