Skip to content

Instantly share code, notes, and snippets.

@ayan4m1
Last active February 16, 2024 07:16
Show Gist options
  • Save ayan4m1/cacac2f7eef496322eaea6bcf9ec9b02 to your computer and use it in GitHub Desktop.
Save ayan4m1/cacac2f7eef496322eaea6bcf9ec9b02 to your computer and use it in GitHub Desktop.

Old npm-upgrade repo from Node 10-12.x era

cloc

github.com/AlDanial/cloc v 1.98 T=0.01 s (1216.9 files/s, 67572.7 lines/s)

Language files blank comment code
JSON 5 0 0 8237
JavaScript 19 179 31 791
Markdown 2 71 0 221
INI 1 4 0 10
-------- -------- -------- -------- --------
SUM: 27 254 31 9259

Package size

$ du -sh lib/

65K lib/

NPM Audit

31 vulnerabilities (16 moderate, 13 high, 2 critical)

New npm-upgrade as ESM, rewritten and optimized

cloc

github.com/AlDanial/cloc v 1.98 T=0.44 s (54.0 files/s, 29070.7 lines/s)

Language files blank comment code
JSON 4 0 0 11386
JavaScript 17 183 36 1003
Markdown 2 71 0 221
INI 1 4 0 10
-------- -------- -------- -------- --------
SUM: 24 258 36 12620

Package size

$ du -sh lib/

62K lib/

NPM Audit

5 moderate severity vulnerabilities

Final Point

Even though I added 300 lines of JS according to cloc, if you take out the lines added by my reducing printWidth to 80 and updating eslint/prettier to modern versions, it's neglegible. I also made a neglegible reduction in bundle size despite adding functionality.

The codebase is cleaner and simpler now, with fewer dependencies. yargs has not navigated the ESM transition well, so commander is a good replacement imo. Rollup will have a much longer life than Gulp at this point. The eslint config of the previous repo was years out of date. There is also a new feature to choose the latest semver-stable release instead of the latest version when making each upgrade choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment