A tiny command line tool that extract `package.json` version and generate `export const VERSION='...'` file. Useful when you want to package your software version.
MIT License
A tiny command line tool that extract package.json
version and generate export const VERSION=x.y.z
file. Useful when you want to package your software version.
npm install const-version
{
"name": "yourproject",
"version": "x.y.z",
"scripts": {
"generate-version": "const-version ./package.json ./src/version.js"
}
}
Example of a generated file
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export const VERSION = 'x.y.z';