node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey ยป



Build Status

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]


  • -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 dependency versions, default to 'all'
    • all: include latest, *, and git urls
    • latest: include latest, *
    • git: incldue git urls
  • -v version: Update the version, default to '1.0.0'
    • major: increase the major
    • minor: increase the minor
    • patch: increase the patch
    • prerelease: increase the prerelease
    • x.y.z: set a version
  • -l license: Update the license, default to 'MIT'

What does it do?

  • 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)