npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yarn-tool/sort-package-json-order

v2.0.5

Published

Predefined sort order for package.json keys / package.json 鍵值的預定義排序順序

Readme

@yarn-tool/sort-package-json-order

Predefined sort order for package.json keys package.json 鍵值的預定義排序順序

NPM version License

Description / 描述

This module exports a predefined sort order for package.json keys. The order follows common conventions and best practices for package.json organization.

此模組匯出 package.json 鍵值的預定義排序順序。 順序遵循 package.json 組織的常見慣例和最佳實踐。

Installation / 安裝

# Using yarn
yarn add @yarn-tool/sort-package-json-order

# Using yarn-tool
yarn-tool add @yarn-tool/sort-package-json-order

# Using yt (yarn-tool alias)
yt add @yarn-tool/sort-package-json-order

# Using npm
npm install @yarn-tool/sort-package-json-order

Usage / 使用方式

import sortOrder from '@yarn-tool/sort-package-json-order';

// Use with sort-object-keys2
import { sortObjectKeys } from 'sort-object-keys2';

const packageJson = {
  dependencies: { ... },
  name: 'my-package',
  version: '1.0.0',
};

const sorted = sortObjectKeys(packageJson, { keys: sortOrder, useSource: true });
// Returns: { name: 'my-package', version: '1.0.0', dependencies: { ... } }

Sort Order / 排序順序

The keys are organized in logical groups:

  1. Metadata - $schema, name, displayName, version, stableVersion, private, description, categories, keywords
  2. Links - homepage, bugs, repository, funding
  3. License & Authors - license, licenses, qna, author, maintainers, contributors, publisher
  4. Entry Points - sideEffects, type, imports, exports, main, svelte, umd:main, jsdelivr, unpkg, module, source, jsnext:main, browser, react-native
  5. Types - types, typesVersions, typings
  6. Resources - style, example, examplestyle, assets
  7. Binaries - bin, man, directories, files
  8. Workspaces - workspaces, binary
  9. Scripts - scripts, betterScripts
  10. Extension Config - l10n, contributes, activationEvents
  11. Git Hooks - husky, simple-git-hooks, pre-commit, commitlint, lint-staged, nano-staged
  12. Tool Config - config, nodemonConfig, browserify, babel, browserslist, xo, prettier, eslintConfig, eslintIgnore, etc.
  13. Testing - ava, jest, jest-junit, jest-stare, mocha, nyc, c8, tap, tsd, oclif
  14. Dependencies - resolutions, overrides, dependencies, devDependencies, dependenciesMeta, peerDependencies, peerDependenciesMeta, optionalDependencies, bundledDependencies, bundleDependencies
  15. Environment - extensionPack, extensionDependencies, flat, packageManager, engines, engineStrict, devEngines, volta, languageName, os, cpu, preferGlobal
  16. Publish - publishConfig, icon, badges, galleryBanner, preview, markdown, pnpm

Related / 相關套件

License / 授權

ISC © bluelovers