lib/npm.js
function listInstalledVer(name, dir) {
        var _child$spawnSync3 = _child_process2['default'].spawnSync(npmCommand, ['list', name, '--depth', '0', '--json'], { cwd: dir });

        var stdout = _child$spawnSync3.stdout;
        var error = _child$spawnSync3.error;
        var status = _child$spawnSync3.status;

        // the package is invalid or uninstalled
        if (error || 0 !== status) {
            return '';
        }

        return JSON.parse(stdout)['version'];
    }
function listInstalledVer(name, dir) {
        var _child$spawnSync3 = _child_process2['default'].spawnSync(npmCommand, ['list', name, '--depth', '0', '--json'], { cwd: dir });

        var stdout = _child$spawnSync3.stdout;
        var error = _child$spawnSync3.error;
        var status = _child$spawnSync3.status;

        // the package is invalid or uninstalled
        if (error || 0 !== status) {
            return '';
        }

        return JSON.parse(stdout)['version'];
    }
function listInstalledVer ( name , dir ) { var _child$spawnSync3 = _child_process2 [ 'default' ] . spawnSync ( npmCommand , [ 'list' , name , '--depth' , '0' , '--json' ] , { cwd : dir } ) ; var stdout = _child$spawnSync3 . stdout ; var error = _child$spawnSync3 . error ; var status = _child$spawnSync3 . status ; // the package is invalid or uninstalled if ( error || 0 !== status ) { return '' ; } return JSON . parse ( stdout ) [ 'version' ] ; }
list specific package version via npm

@param {String} [name] published package name
@param {String} [dir] list directory
@public
list specific package version via npm