1.0.7 • Published 6 years ago

curr-ver v1.0.7

Weekly downloads
12
License
ISC
Repository
github
Last release
6 years ago

Curr-Ver

Write current version details in the format of a json object to stdout.

Description

This executable is a no-nonsense way to output current npm version and git hash details, for consumption by other scripts. This is also handy for generating version details to be consumed by a web frontend.

Writes to stdout, and is unopinionated about what to do with the version information.

Note: This assumes you desire to leverage both npm and git version details.

Usage

Run manually from the command line with:

npx curr-ver

Write those details to a file like:

npx curr-ver > ./.version.json

Install as a utility in your project:

npm install --save-dev curr-ver

Run as a commit hook with a utility like Husky. In your package.json:

  "husky": {
    "hooks": {
      "post-commit": "curr-ver > ./.version.json",
      "post-checkout": "curr-ver > ./.version.json"
    }
  }

Below are available cmd line args.

Output sample:

{"version":"1.0.1","hash":"6fb8b2d7"}
Argdefaultdescription
--suffixnoneAdds a suffix to the version, such as 'dev' in 1.0.0-dev
--git-dirnoneIf operating at a different location than the project root (alongside ./.git). Useful if receiving the error fatal: Not a git repository: '.git'

Roadmap

Things to do (ideas)

  • Add branch information
  • (maybe) add file output option
  • Add other suggested options
1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago