parcel-plugin-package-version
v1.0.2
Published
Parcel plugin to read version from package.json
Downloads
40
Maintainers
Readme
parcel-plugin-package-version
Parcel plugin to read version from package.json
Install
# npm
npm i -D parcel-plugin-package-version
# or yarn
yarn add -D parcel-plugin-package-version
How to use
This plugin puts the package version in an environment variable named PACKAGE_VERSION
.
you can retrive it in js like this: process.env.PACKAGE_VERSION
Example
package.json
{
"version": "1.2.3",
...
}
javascript
console.log("package version: " + process.env.PACKAGE_VERSION);
output
package version: 1.2.3