https://github.com/fabiospampinato/get-current-version
Get the version of the currently executing bin.
https://github.com/fabiospampinato/get-current-version
cli current get version
Last synced: 4 months ago
JSON representation
Get the version of the currently executing bin.
- Host: GitHub
- URL: https://github.com/fabiospampinato/get-current-version
- Owner: fabiospampinato
- License: mit
- Created: 2023-02-07T15:46:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T18:50:28.000Z (over 1 year ago)
- Last Synced: 2025-09-18T18:51:18.938Z (9 months ago)
- Topics: cli, current, get, version
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Get Current Version
Get the version of the currently executing bin.
This is meant to be used in combination with [`tiny-updater`](https://github.com/fabiospampinato/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`](https://github.com/fabiospampinato/get-current-package) for a more general version of this package.
## Install
```sh
npm install get-current-version
```
## Usage
You should have something like this in your bin app:
```ts
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