Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
whybundled
Advanced tools
Ever wondered why any particular module ended up in a bundle? WhyBundled is here to answer exactly this question.
It's meant to be used alongside stats report from webpack.
npm i -g whybundled
whybundled stats.json ← stats file generated by wepback
Usage
$ whybundled stats.json "[pattern]" [default command]
$ whybundled stats.json --ignore babel-runtime,tslib [default command]
$ whybundled stats.json --by styled-components [by command]
Default options:
[pattern] Optional pattern used to filter output to only matched modules
Note: you might need to wrap the pattern in quotes to use wildcards, e.g. "*.jsx"
--ignore Comma separated list of glob pattern to exclude modules from final output
--modulesOnly Only include modules
--filesOnly Only include files
--directOnly Only include direct dependencies
--transitiveOnly Only include transitive dependencies
--duplicatesOnly Only include modules that have duplicates in a resulting bundle
--limit Limits output of reasons and files [default: 20]
By options [--by]:
--ignore Comma separated list of glob pattern to exclude modules from final output
--limit Limits output of reasons and files [default: 20]
--only Limits output to only include modules that were included by specified module exclusively
Other options:
-v, --version Shows version.
--help Shows help.
Examples
$ whybundled stats.json --modulesOnly
MODULE isobject
├─ imported: 1 time ← number of times module imported
├─ type: [transitive] ← type of a dependency can be either direct or transitive
│ └─ isobject -> is-plain-object -> styled-components ← for transitive dependencies whybundled outputs a chain of dependencies up to the closest direct
│
├─ locations: ← where module is located in a project
│ └─ ../node_modules/isobject/
│
├─ files: ← list of files that were included for this module
│ └─ ../node_modules/isobject/index.js
│
└─ reasons: ← list of reasons why module was included in a bundle
└─ is-plain-object
└─ ../node_modules/is-plain-object/index.js 10:15-34 [cjs require]
If module has been bundled several times from different locations whybundled
adds [multiple]
badge next to the locations field:
Using --by
flag whybundled
shows all modules that were brought into the bundle by a particular module:
whybundled stats.json --by styled-components
FAQs
Answers the question – Why the hell is this module in a bundle?
The npm package whybundled receives a total of 1,928 weekly downloads. As such, whybundled popularity was classified as popular.
We found that whybundled 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.