
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
require-traverser
Advanced tools
A library for finding all the nested dependencies of a commonJS/node.js module. Uses 'detective' to traverse files.
Status: API finalized, needs testing
A library for finding all the nested dependencies of a commonJS/node.js module. Uses 'detective' to traverse files.
npm install require-traverser
var rt = require('require-traverser')
Two ways to call rt
:
<directory>
, <module>
, [<opts>
,] <errback>
<moduleList>
, [<opts>
,] <errback>
where
<directory>
is the directory path from which to search for the module<module>
is the module to get dependencies from<moduleList>
is an array of objects like: {dir: , module: }<errback>
is a standard node.js errback (where the first parameter is the error, undefined if there was none, and the second parameter is the return value)<opts>
is optional, and can have any of the parameters:
rt
returns (to the errback) an object like:
{<filename>:
{resolved: [
{relative: <modulePath>, absolute: <absolute filesystem path>},
...
],
unresolved: <require expressions that couldn't be resolved>,
unfound: <require dependencies that couldn't be found>
}
}
Example traversed module:
require("./testModule/")
var x = "whatever"
require(x)
require('dep'+'endency')
require("http")
require("url")
Example result:
{"/home/vagrant/temporaryPackageFolder/node_modules/http-proxy/lib/http-proxy.js":
{"resolved":[
{"relative":"./testModule/","absolute":"/home/vagrant/temporaryPackageFolder/node_modules/testModule/lib/testModule.js"}
],
"unresolved":["'dep'+'endency'", "x"],
"unfound":["http","url"]
}
}
rt
doesn't resolve node.js native libraries (returns them as 'unfound').
Anything helps:
How to submit pull requests:
npm install
at its rootReleased under the MIT license: http://opensource.org/licenses/MIT
FAQs
A library for finding all the nested dependencies of a commonJS/node.js module. Uses 'detective' to traverse files.
We found that require-traverser 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.