get-current-version

Get the version of the currently executing bin.

MIT 3 个版本
安装
npm install get-current-version
yarn add get-current-version
pnpm add get-current-version
bun add get-current-version
README

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.

See get-current-package for a more general version of this package.

Install

npm install 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

版本列表
1.0.2 2025-01-12
1.0.1 2023-02-11
1.0.0 2023-02-07