unstale

npm / sort-package-json

sort-package-json

What changed in sort-package-json 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-12.

3 breaking1 new APIs and options4 behavior and defaults4 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.12 on npm

sort-package-json 43 changes

Breaking changes 2

  • The minimum supported Node.js version is now 22; Node.js 20 is no longer supported.

    4.0.0release notes

  • The polyfill was removed and Object.groupBy is called directly, so Node.js 20 contexts need an Object.groupBy polyfill to run this version.

    4.0.0release notes

Behavior and default changes 1

  • sort-package-json now sorts keys in the allowScripts package field.

    4.1.0release notes

sort-package-json 39 changes

Breaking changes 1

  • Support for Node v12.x through v18.x was dropped; the minimum supported version is now v20.x.

    3.0.0release notes

New APIs and options 1

Behavior and default changes 3

  • sort-package-json now sorts wireit configuration.

    3.7.0release notes

  • Dependencies are sorted according to the detected package manager.

    3.6.0release notes

  • The sorter now sorts types and default keys in the exports field.

    3.5.0release notes

Fixes and other changes 4

  • Reverts the change that dropped support for Node.js 20.

    3.7.1release notes

  • Stops forcing the types entry in exports to be first.

    3.6.1release notes

  • The sorter now handles colon-prefixed script names.

    3.5.2release notes

  • Improves sorting of scripts in package.json.

    3.5.1release notes