sort-package-json-scripts
TypeScript icon, indicating that this package has built-in type declarations

1.1.26 • Public • Published

README.md

a better sort package.json scripts, by default is follow npm lifecycle scripts

install

yarn add sort-package-json-scripts
yarn-tool add sort-package-json-scripts
import sortPackageJsonScripts from 'sort-package-json-scripts';

let ret = sortPackageJsonScripts({

	"lint": "npx eslint *.ts",

	"npm:publish": "npm publish",

	"prepublish:lockfile": "npx sync-lockfile .",
	"tsc:esm": "tsc -p tsconfig.esm.json",
	"ncu": "npx yarn-tool ncu -u",
	"sort-package-json": "npx yarn-tool sort",
	"test": "jest --coverage",
	"coverage": "npx nyc yarn run test",
	"test:mocha": "npx mocha --require ts-node/register \"!(node_modules)/*.{test,spec}.{ts,tsx}\"",
	"tsc:default": "tsc -p tsconfig.json",

	"prepublishOnly": "yarn run ncu && yarn run sort-package-json && yarn run test",

	"postpublish_": "git commit -m \"chore(release): publish\" .",
})

console.log(ret)
/*
{
	coverage: 'npx nyc yarn run test',
	lint: 'npx eslint *.ts',
	test: 'jest --coverage',
	'test:mocha': 'npx mocha --require ts-node/register "!(node_modules)/*.{test,spec}.{ts,tsx}"',
	'npm:publish': 'npm publish',
	'prepublish:lockfile': 'npx sync-lockfile .',
	prepublishOnly: 'yarn run ncu && yarn run sort-package-json && yarn run test',
	postpublish_: 'git commit -m "chore(release): publish" .',
	ncu: 'npx yarn-tool ncu -u',
	'sort-package-json': 'npx yarn-tool sort',
	'tsc:default': 'tsc -p tsconfig.json',
	'tsc:esm': 'tsc -p tsconfig.esm.json'
}
 */

Readme

Keywords

none

Package Sidebar

Install

npm i sort-package-json-scripts

Weekly Downloads

32

Version

1.1.26

License

ISC

Unpacked Size

47.6 kB

Total Files

21

Last publish

Collaborators

  • bluelovers