get-current-package
Get the package.json of the currently executing bin.
Last updated 2 years ago by fabiospampinato .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install get-current-package 
SYNC missed versions from official npm registry.

Get Current Package

Get the package.json of the currently executing bin.

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

Install

npm install get-current-package

Usage

You should have something like this in your bin app:

import getCurrentPackage from 'get-current-package';

console.log ( getCurrentPackage () );

Then executing the bin would produce this:

> my-bin
< { name: 'my-bin', version: '1.0.0', ... }

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

License

MIT © Fabio Spampinato

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE