get-current-version
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Get Current Version

Get the version of the currently executing bin.

This is meant to be used in combination with tiny-updater or similar, in order to get the version of the currently executing bin very conveniently, without importing a "package.json" and without hard-coding the version number yourself.

Install

npm install --save get-current-version

Usage

You should have something like this in your bin app:

import getCurrentVersion from 'get-current-version';

console.log ( getCurrentVersion () ); // 1.0.0

Then executing the bin would produce this:

> my-bin
< 1.0.0

Basically it detects which entrypoint file is being executed and retrieves its version.

License

MIT © Fabio Spampinato

Readme

Keywords

Package Sidebar

Install

npm i get-current-version

Weekly Downloads

2

Version

1.0.1

License

none

Unpacked Size

3.68 kB

Total Files

9

Last publish

Collaborators

  • fabiospampinato