parcel-plugin-package-version

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i parcel-plugin-package-version

Weekly Downloads

411

Version

1.0.2

License

MIT

Unpacked Size

294 kB

Total Files

8

Last publish

Collaborators

  • mehdi_s