
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
browserify-breakdown
Advanced tools
break down and analyze browserify/browser-pack bundles
browserify main.js > bundle.js
browserify-breakdown < bundle.js
Prints a breakdown of the browser-pack bundle with individual module size and total module size. If the bundle is being created using browserify, the flag --full-paths
/ option fullPaths
may be specified to include module paths in the output instead of integer IDs.
var breakdown = require('browserify-breakdown')
breakdown(bundleSrc)
Returns a breakdown of the browser-pack
bundle. The returned result is the result of walking through the dependency graph of the bundle with circular dependencies broken.
Each node in the returned result has the following properties:
id
: The module id.size
: The module size, in UTF-8 bytestotalSize
: The totalled size of the module and its dependencies, excluding circular and repeated dependencies.deps
: An array of the module's dependencies.The top-level node is a dummy node representing the whole bundle with id=0
and size=0
.
breakdown.core(bundleSrc)
The core breakdown function. Useful if you want more information about the nodes in the graph.
Returns an object with the properties:
info
: Raw information about a module in module-deps format.graph
: An adjacency matrix of the initial dependency graph, a directed graph. Entry modules are dependencies of the dummy node entry:
. Nodes are simply module IDs.result
: Same as the output of the breakdown
function. The dummy node entry:
is stripped.isolatedNodes
: An array with all the isolated modules. Normally, all modules should be a descendant of an entry module or an entry module itself, so this should be empty if that's the case.I created this module as a lower-level alternative to disc, which for some reason always breaks whenever I try to use it. I cannot find any other analyzer for browserify, too. So I intend this to be something a bit better than disc
.
npm ls
)browserify --full-paths
input, that's fine. If your module IDs are integers, that's fine too... you'll see the integers being used as module IDs. 😜disc
does, and possibly more.FAQs
break down and analyze browserify/browser-pack bundles
The npm package browserify-breakdown receives a total of 3 weekly downloads. As such, browserify-breakdown popularity was classified as not popular.
We found that browserify-breakdown 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.