program-version

    1.0.0 • Public • Published

    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

    Install

    npm i program-version

    DownloadsWeekly Downloads

    134

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • wilmoore