Skip to content

v1.1.0 — diff subcommand

Choose a tag to compare

@Booyaka101 Booyaka101 released this 25 Jul 08:40

diff — compare install scripts across two versions

npx npm-script-lens diff <pkg>@<old> <pkg>@<new> shows exactly which install-time behavior an upgrade adds or changes before you bump a pin.

  • Diffs preinstall/install/postinstall + the implicit node-gyp rebuild (root binding.gyp), straight from the registry.
  • UNCHANGED (green) / ADDED (red, incl. implicit node-gyp rebuild (binding.gyp)) / REMOVED (yellow) / MODIFIED (red, with a line-level diff).
  • --json emits { unchanged, added, removed, modified }.
  • Exit 1 on any added/modified script (a CI gate for upgrades that grow their install surface), else 0 (pure removals stay 0).
$ npx npm-script-lens diff sharp@0.32.6 sharp@0.33.0
sharp@0.32.6 → sharp@0.33.0
REMOVED: implicit node-gyp rebuild (binding.gyp)
MODIFIED: install
    - (node install/libvips && node install/dll-copy && prebuild-install) || …
    + node install/check

Full changelog: see CHANGELOG.md.