sort-scripts
Sort a map of scripts in a logical order
Last updated a year ago by camacho .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sort-scripts 
SYNC missed versions from official npm registry.

sort-scripts

Sort scripts based on prefix and suffix

Usage

Given an map of script names to behavior (as is found in package.json files for Node projects), sort the scripts in a logical order, considering pre and post prefixes:

const sort = require('sort-scripts');
const scripts = {
  test: "jest",
  pretest: "check-engines",
  postmerge: "lint-staged",
  docs: "markdown-magic",
  postdocs: "echo \"'.md' files updated\""
};

sort(scripts);
// [
//   ["docs", "markdown-magic"], 
//   ["postdocs", "echo \"'.md' files updated\"],
//   ["postmerge", "lint-staged"],
//   ["pretest", "check-engines"],
//   ["test", "jest"]
// ]

Current Tags

  • 1.0.1                                ...           latest (a year ago)

2 Versions

  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 5
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2014 - 2017 © taobao.org |