npm
npmjs.com › package › prettier-plugin-sort-json
prettier-plugin-sort-json - npm
January 10, 2025 - Start using prettier-plugin-sort-json in your project by running `npm i prettier-plugin-sort-json`. There are 72 other projects in the npm registry using prettier-plugin-sort-json.
» npm install prettier-plugin-sort-json
Published Jan 13, 2026
Version 4.2.0
GitHub
github.com › matzkoh › prettier-plugin-packagejson
GitHub - matzkoh/prettier-plugin-packagejson: Prettier plugin for package.json
Starred by 382 users
Forked by 11 users
Languages JavaScript 90.7% | TypeScript 9.3% | JavaScript 90.7% | TypeScript 9.3%
GitHub
github.com › Gudahtt › prettier-plugin-sort-json
GitHub - Gudahtt/prettier-plugin-sort-json: A plugin for Prettier that sorts JSON files by property name.
This will not sort JSON objects within other types of files, such as JavaScript or TypeScript files. This is just for sorting JSON files. This module requires an LTS Node version (v16.0.0+), and prettier v3+. We are maintaining support for Prettier v2 on version 2 of this plugin.
Starred by 122 users
Forked by 16 users
Languages TypeScript 95.0% | JavaScript 4.6% | Shell 0.4% | TypeScript 95.0% | JavaScript 4.6% | Shell 0.4%
GitHub
github.com › prettier-plugins › sort-package-json
GitHub - prettier-plugins/sort-package-json: A prettier plugin thats sorts your package.json using the sort-package-json npm package
A prettier plugin thats sorts your package.json using the sort-package-json npm package - prettier-plugins/sort-package-json
Author prettier-plugins
npm
npmjs.com › package › prettier-plugin-packagejson
prettier-plugin-packagejson - npm
January 20, 2026 - Start using prettier-plugin-packagejson in your project by running `npm i prettier-plugin-packagejson`. There are 405 other projects in the npm registry using prettier-plugin-packagejson.
» npm install prettier-plugin-packagejson
Published Mar 05, 2026
Version 3.0.2
GitHub
github.com › trivago › prettier-plugin-sort-imports › blob › main › package.json
prettier-plugin-sort-imports/package.json at main · trivago/prettier-plugin-sort-imports
"name": "@trivago/prettier-plugin-sort-imports", "version": "6.0.2", "description": "A prettier plugins to sort imports in provided RegEx order", "main": "lib/src/index.js", "type": "module", "types": "types/index.d.ts", "repository": { "url": "https://github.com/trivago/prettier-plugin-sort-imports", "type": "git" }, "homepage": "https://github.com/trivago/prettier-plugin-sort-imports#readme", "scripts": { "prepare": "yarn run compile", "compile": "tsc", "preexample": "yarn run compile", "example": "prettier --config ./examples/.prettierrc", "test": "vitest run", "type-check": "tsc --noEmit", "prepublishOnly": "npm run compile && npm run test", "prettify": "yarn prettier --write ."
Author trivago
npm
npmjs.com › package › prettier-plugin-json-sort
prettier-plugin-json-sort - npm
December 9, 2023 - Latest version: 0.0.2, last published: 2 years ago. Start using prettier-plugin-json-sort in your project by running `npm i prettier-plugin-json-sort`. There are 4 other projects in the npm registry using prettier-plugin-json-sort.
» npm install prettier-plugin-json-sort
Published Dec 09, 2023
Version 0.0.2
Author Soybean
GitHub
github.com › prettier › prettier › issues › 4040
Idea: sort package.json keys · Issue #4040 · prettier/prettier
February 25, 2018 - prettier / prettier Public · There was an error while loading. Please reload this page. Notifications · You must be signed in to change notification settings · Fork 4.7k · Star 51.5k · New issueCopy link · New issueCopy link · Closed · Closed · Idea: sort package.json keys#4040 ·
Author simonepri
GitHub
github.com › cameronhunter › prettier-package-json
GitHub - cameronhunter/prettier-package-json: Prettier formatter for package.json files · GitHub
prettier-package-json is a JSON formatter inspired by prettier. It removes all original styling and ensures that the outputted package.json conforms to a consistent style. By default it uses opinionated defaults but can be configured to your ...
Starred by 157 users
Forked by 18 users
Languages TypeScript 85.6% | JavaScript 14.4%
Top answer 1 of 11
252
The sort-package-json package sorts not only dependencies and devDependencies, but other keys as well. I know the original questions didn't ask about the other keys, but I think it's cool to have all keys sorted.
You can simply run:
npx sort-package-json
Example from the package page:
$ cd my-project
$ cat package.json
{
"dependencies": {
"sort-package-json": "1.0.0",
"sort-object-keys": "1.0.0"
},
"version": "1.0.0",
"name": "my-awesome-project"
}
$ npx sort-package-json
package.json is sorted!
$ cat package.json
{
"name": "my-awesome-project",
"version": "1.0.0",
"dependencies": {
"sort-object-keys": "1.0.0",
"sort-package-json": "1.0.0"
}
}
This does not remove the trailing newline like the npm-sort package mentioned by Wolfgang.
Multiple files
$ sort-package-json "my-package/package.json" "other-package/package.json"
$ sort-package-json "package.json" "packages/*/package.json"
2 of 11
143
Just run npm remove --save anything or npm remove --save-dev whatever and npm will sort that section, without actually touching any of the content. Of course you should make sure that the package name you pass it (which can be anything, spam your keyboard) isn't in your package.json.
GitHub
github.com › Gudahtt › prettier-plugin-sort-json › tree › main-v2
GitHub - Gudahtt/prettier-plugin-sort-json at main-v2
A plugin for Prettier that sorts JSON files by property name. - GitHub - Gudahtt/prettier-plugin-sort-json at main-v2
Starred by 117 users
Forked by 15 users
Languages TypeScript 94.9% | JavaScript 4.7% | Shell 0.4% | TypeScript 94.9% | JavaScript 4.7% | Shell 0.4%
npm
npmjs.com › package › prettier-package-json
prettier-package-json - npm
December 23, 2022 - prettier-package-json is a JSON formatter inspired by prettier. It removes all original styling and ensures that the outputted package.json conforms to a consistent style. By default it uses opinionated defaults but can be configured to your ...
» npm install prettier-package-json
Published Dec 23, 2022
Version 2.8.0
Author Cameron Hunter
GitHub
github.com › Gudahtt › prettier-plugin-sort-json › releases
Releases · Gudahtt/prettier-plugin-sort-json
A plugin for Prettier that sorts JSON files by property name. - Releases · Gudahtt/prettier-plugin-sort-json
Author Gudahtt
Stack Overflow
stackoverflow.com › questions › 74464506 › how-to-lint-or-prettier-a-json-file-with-vscode-in-alphabetical-order
visual studio code - how to lint or prettier a json file with vscode in alphabetical order - Stack Overflow
It works with Prettier extension, ... the library itself in your workspace. npm init -y // in case you have not already a package.json npm add -D prettier prettier-plugin-sort-json ·...
Npm
npm.io › package › prettier-plugin-sorted-json
Prettier-plugin-sorted-json NPM | npm.io
Weekly downloads · - License · ... name. This module requires an LTS Node version (v10.0.0+), and prettier v2.0.0+. Using npm: npm install --save-dev prettier-plugin-sort-json ·...
Npm
npm.io › package › prettier-plugin-sort-json
Prettier-plugin-sort-json NPM | npm.io
Check Prettier-plugin-sort-json 4.1.1 package - Last release 4.1.1 with MIT licence at our NPM packages aggregator and search engine.
Awesomeopensource
awesomeopensource.com › project › cameronhunter › prettier-package-json
Prettier Package Json Alternatives
Turns off all rules that are ... with Prettier. dependent packages 137,200total releases 72latest release December 02, 2023most recent commit 2 years ago ... An opinionated collection of components, hooks, and utilities for your Next.js project. ... No Spam. Unsubscribe easily at any time. ... Downloads, Dependent ...