sort-package-deps

1.44.0 • Public • Published

sort-dependencies

npx sort-dependencies <path-to-package-dir-or-package.json> --apply

Why

Some toolchains like @microsoft/rush or pnpm make changes to package.json dependencies without keeping the alphabetical order. This can also happen when doing manual changes of course.

The problem arises when tools like pnpm publish in combination with rush then sort the dependencies alphabetically but don't commit it back leaving a dirty repo which causes pnpm to abort publishing.

sort-dependencies is thus useful in

I also could somehow not find another package that did this the way I liked. prettier-package-json was close but did way more and also reordered the the root properties themselves which I did not like.

Package Sidebar

Install

npm i sort-package-deps

Weekly Downloads

84

Version

1.44.0

License

MIT

Unpacked Size

1.41 MB

Total Files

19

Last publish

Collaborators

  • matthiasg