
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@esmj/size
Advanced tools
The @esmj/size show you javascript cost for your defined packages. The packages is bundled with Webpack. Then show the bundle size and downloaded time for javascript bundle.
npm install -g @esmj/size
esmj-size @merkur/core
// or
npx @esmj/size @merkur/core
esmj-size react,react-dom
# ┌────────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────┐
# │ Package │ Minify │ Minify+Gzip │ Minify+Brotli │
# ├────────────────────────────────────────┼────────────────────┼────────────────────┼────────────────────┤
# │ react,react-dom │ 136.28 KB │ 41.49 KB │ 36.03 KB │
# └────────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────┘
# ┌────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┐
# │ Bundle │ 2g │ 3g │ 4g │ 5g │
# ├────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┤
# │ minify │ 11.63 s │ 2.79 s │ 159.48 ms │ 62.02 ms │
# ├────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┤
# │ gzip │ 3.54 s │ 849.76 ms │ 48.56 ms │ 18.88 ms │
# ├────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┤
# │ brotli │ 3.07 s │ 737.82 ms │ 42.16 ms │ 16.4 ms │
# └────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┘
# ┌────────────────────┬──────────┬──────────────────────────────┬──────────┬──────────┬───────────────┬───────────────┬───────────────┐
# │ package │ source │ downloads day / week / month │ version │ license │ created │ updated │ unpacked size │
# ├────────────────────┼──────────┼──────────────────────────────┼──────────┼──────────┼───────────────┼───────────────┼───────────────┤
# │ react │ npm │ 2.36M / 15.26M / 64.29M │ 18.1.0 │ MIT │ 2011-10-26 │ 1 days ago │ 308.05 KB │
# ├────────────────────┼──────────┼──────────────────────────────┼──────────┼──────────┼───────────────┼───────────────┼───────────────┤
# │ react-dom │ npm │ 2.18M / 14.03M / 59.02M │ 18.1.0 │ MIT │ 2014-5-6 │ 1 days ago │ 4.2 MB │
# └────────────────────┴──────────┴──────────────────────────────┴──────────┴──────────┴───────────────┴───────────────┴───────────────┘
esmj-size easy-uid --pretty
# {
# bundle: {
# minify: {
# size: 307,
# speed: {
# '2g': 25.583333333333332,
# '3g': 6.14,
# '4g': 0.35085714285714287,
# '5g': 0.13644444444444445
# }
# },
# gzip: {
# size: 226,
# speed: {
# '2g': 18.833333333333332,
# '3g': 4.52,
# '4g': 0.2582857142857143,
# '5g': 0.10044444444444445
# }
# },
# brotli: {
# size: 180,
# speed: { '2g': 15, '3g': 3.6, '4g': 0.2057142857142857, '5g': 0.08 }
# }
# },
# 'easy-uid': {
# source: 'npm',
# downloads: { day: 3, week: 38, month: 142 },
# info: {
# license: 'ISC',
# created: 2018-09-07T14:45:00.352Z,
# updated: 2022-04-30T19:18:42.984Z,
# version: '2.0.2',
# unpackedSize: 5196
# }
# }
# }
--pretty - Output the result as a pretty-printed object instead of tables--json - Output the result in JSON format only--help - Display all available commands and settings--registry - Specify a custom npm registry URL--external - Define external dependencies for webpack config (dependencies that should not be bundled)--bundle - Bundle all dependencies with external dependencies and enable tree shaking--no-tree-shaking - Disable tree shaking (usedExports) — only effective with --bundle--no-side-effects - Disable side effects optimization (sideEffects)--full - Measure real package size without any optimizations (alias for --bundle --no-tree-shaking --no-side-effects)--explain - Display detailed webpack stats output for debugging--code <string> - Provide a code snippet to analyze instead of package imports--local <dir> - Add a local package directory (repeatable), including current directory via --local .Analyze a specific package version:
esmj-size react@17.0.2
esmj-size lodash@4.17.21,moment@2.29.4
Analyze with custom code snippet:
esmj-size react --code "import React from 'react'; console.log(React.version);"
Output as JSON:
esmj-size lodash --json
Bundle with external dependencies:
esmj-size react-dom --external react --bundle
Use custom npm registry:
esmj-size @myorg/package --registry https://custom-registry.example.com
Analyze local package directory:
esmj-size --local .
esmj-size react --local ./packages/local-lib
esmj-size --local ./packages/local-a --local ./packages/local-b
Bundle without tree shaking:
esmj-size react --bundle --no-tree-shaking
Bundle without side effects optimization:
esmj-size react --no-side-effects
esmj-size react --bundle --no-tree-shaking --no-side-effects
Measure real package size (no optimizations):
esmj-size react --full
The tool calculates download times based on the following network speeds:
You can display all available commands and settings with following command:
esmj-size --help
FAQs
JavaScript Package Size Cost like bundlephobia or import-cost
The npm package @esmj/size receives a total of 32 weekly downloads. As such, @esmj/size popularity was classified as not popular.
We found that @esmj/size demonstrated a healthy version release cadence and project activity because the last version was released less than 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 mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.