{"library":"prettier-plugin-package","title":"Prettier Plugin Package","description":"An opinionated package.json formatter plugin for Prettier, enforcing a consistent key ordering style popularized by Sindre Sorhus. v2.0.0 requires Node >=20.19.0 and Prettier ^3.0.0. It sorts top-level keys, and alphabetizes scripts, files, and engines. Differentiates from other package.json formatters by its strict opinionated ordering and automatic key classification. Released under MPL-2.0, maintained by shellscape, with monthly releases.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-package"],"cli":null},"imports":["// No explicit import needed; Prettier auto-loads plugins","// prettier.config.js\nmodule.exports = { plugins: ['prettier-plugin-package'] }","// No plugin-specific options"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install: npm install --save-dev prettier prettier-plugin-package\n\n// package.json (initial state)\n{\n  \"devDependencies\": { \"prettier\": \"^3.0.0\" },\n  \"scripts\": { \"build\": \"echo build\", \"test\": \"echo test\", \"lint\": \"echo lint\" },\n  \"description\": \"My package\",\n  \"name\": \"my-pkg\",\n  \"version\": \"1.0.0\"\n}\n\n// After running: npx prettier --write package.json\n// The keys will be reordered per the plugin's sort order:\n{\n  \"name\": \"my-pkg\",\n  \"version\": \"1.0.0\",\n  \"description\": \"My package\",\n  \"scripts\": {\n    \"build\": \"echo build\",\n    \"lint\": \"echo lint\",\n    \"test\": \"echo test\"\n  },\n  \"devDependencies\": {\n    \"prettier\": \"^3.0.0\"\n  }\n}","lang":"javascript","description":"Demonstrates automatic sorting of keys and scripts in package.json after running Prettier with the plugin.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}