Socket
Socket
Sign inDemoInstall

program-version

Package Overview
Dependencies
2
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    program-version

Returns the program/package name and version as a string with optional format customization.


Version published
Weekly downloads
268
increased by0.37%
Maintainers
1
Install size
26.2 kB
Created
Weekly downloads
 

Changelog

Source

1.0.0 - 2015-12-13

Changed

  • Curried API supporting root directory specification.

Readme

Source

program-version

Build Status NPM version NPM downloads LICENSE

Returns the program/package name and version as a string with optional format customization.

$ npm install program-version --save

Usage

import and configure.
// specify directory of `package.json`
var version = require('program-version')(__dirname)

// directory of `package.json` is inferred
var version = require('program-version')()
program/package name, leading v and version.
version()
//=> program vN.N.N

Format Options

  • %(program)s: program/package name
  • %(vprefix)s: v
  • %(version)s: version (i.e. 0.1.0)
program/pacakge name only.
version('%(program)s');
//=> program
program/package name and version (no leading v).
version('%(program)s %(version)s');
//=> program N.N.N
version only.
version('%(version)s');
//=> N.N.N

License

MIT

Keywords

FAQs

Last updated on 09 Dec 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc