module-tidyup

A simple utility to tidy up a module package.json

module-tidyup

A simple utility to tidy up Node.js module package.json before publishing

Before we publish a module to npm registry, typically there are a few things that requires tidy-up.

  • The module version
  • The license
  • Dependencies that use internal git/http urls
  • Set private to be false
npm install -g module-tidyup
tidyup [-i] [-u] [-d] [-v version] [-l license]

Options:

  • -i: Run npm install -f first to refresh the dependencies
  • -u: Update the package.json, if not set, the revised content is dumped to stdout
  • -d: Update dependencies for 'latest' or git/http urls, default to true
  • -v version: Update the version, use 'major'/'minor'/'patch'/'prerelease' to increment, default to '1.0.0'
  • -l license: Update the license, default to 'MIT'
  • Run npm install -f (if -i)
  • Run npm ls --json
  • Open package.json and tidy it up
  • Write the result back to package.json (if -u)

MIT