New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

get-current-package

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-current-package

Get the package.json of the currently executing bin.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
decreased by-28.14%
Maintainers
0
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 12 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc