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-it
Advanced tools
This module extends the default Node.js require with capabilities to require nested modules, independent on where they are nested.
This module extends the default Node.js require with capabilities to require nested modules, independent of where they are nested.
npm install require-it --save
myPackage
+ node_modules
| + direct-dependecy
| | + node_modules
| | | \ nested-module
| | | + index.js
| | | \ package.json
| | + index.js
| | \ package.json
| + index.js
| \ package.json
+ index.js
\ package.json
myPackage/index.js
:
const { requireIt } = require('require-it');
// it will work and won't throw error
const nestedModule = requireIt('nested-module');
requireIt(moduleName)
Requires the given local module, independent of which level it is.
requireIt.resolve(moduleName)
Returns the local path, which could be required by require
.
requireIt.directory(moduleName)
Returns the local path, which could be required by require
without the main JS file, i.e., the path to the module's directory.
requireGlobal(globalModuleName)
Requires the given global module.
requireGlobal.resolve(globalModuleName)
Returns the global path, which could be required by require
.
requireGlobal.directory(globalModuleName)
Returns the global path, which could be required by require
without the main JS file, i.e., the path to the module's directory.
requireFrom(moduleName, root)
Requires the given module found in the given root directory.
requireFrom.resolve(moduleName, root)
Returns the module's path, which could be required by require
, found in the given root directory.
requireFrom.directory(moduleName, root)
Returns the module's path, which could be required by require
without the main JS file, i.e., the path to the module's directory, found in the given root directory.
FAQs
This module extends the default Node.js require with capabilities to require nested modules, independent on where they are nested.
The npm package require-it receives a total of 11,922 weekly downloads. As such, require-it popularity was classified as popular.
We found that require-it 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.