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 initsort-package-json 43 changes
Breaking changes 2
The minimum supported Node.js version is now 22; Node.js 20 is no longer supported.
The polyfill was removed and Object.groupBy is called directly, so Node.js 20 contexts need an Object.groupBy polyfill to run this version.
Behavior and default changes 1
sort-package-json now sorts keys in the allowScripts package field.
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.
New APIs and options 1
The devEngines field is supported.
Behavior and default changes 3
sort-package-json now sorts wireit configuration.
Dependencies are sorted according to the detected package manager.
The sorter now sorts types and default keys in the exports field.
Fixes and other changes 4
Reverts the change that dropped support for Node.js 20.
Stops forcing the types entry in exports to be first.
The sorter now handles colon-prefixed script names.
Improves sorting of scripts in package.json.