Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
rollup-analyzer
Advanced tools
Analyze file sizes of rollup bundled imports
Rollup Analyzer gives you a quick look at what's taking up space in your bundle.
Adding as a plugin to your rollup config or build script will print a well formatted analysis to the console upon bundling.
If using Rollup's CLI to bundle with no additonal config, pass
-c node:rollup-analyzer-config
to print a well formatted analysis to your console.
Full analysis module, giving you access to the complete analysis object or well formatted analysis text for CI and build usage.
$ npm install --save-dev rollup-analyzer
const rollupAnalyzer = require('rollup-analyzer')({limit: 5})
rollup.rollup({/*...*/}).then((bundle) => {
// print console optimized analysis string
rollupAnalyzer.formatted(bundle).then(console.log).catch(console.error)
})
// Results in ...
/*
-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 1.146 MB
-----------------------------
file: \node_modules\html5-history-api\history.js
size: 38.502 KB
percent: 3.36%
dependents: 1
- \app\modules\page.js
-----------------------------
file: \node_modules\pikaday\pikaday.js
size: 34.683 KB
percent: 3.03%
dependents: 1
- \app\helpers\transformer.js
...
*/
the default exported function is identical to init, and returns the same functions as export {init, formatted, analyze}. So, you can require('rollup-analyzer')
or require('rollup-analyzer')({limit: 5})
and use the same functions.
set options to use in analysis (this step is optional)
null
null
process.cwd()
returns Promise which resolves with well formatted analysis string (for CLI printing)
returns Promise which resolves with array of objects describing each imported file
returned array's child analysis objects have the following properties
MIT © Andrew Carpenter
FAQs
Analyze file sizes of rollup bundled imports
The npm package rollup-analyzer receives a total of 30 weekly downloads. As such, rollup-analyzer popularity was classified as not popular.
We found that rollup-analyzer 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.