-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BREAKING] drop support for Node.js < 6
- Loading branch information
Showing
3 changed files
with
2,672 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
'use strict'; | ||
|
||
const join = require('path').join; | ||
const {join} = require('path'); | ||
|
||
const npmCliDir = require('npm-cli-dir'); | ||
|
||
module.exports = function npmCliVersion() { | ||
module.exports = function npmCliVersion(...args) { | ||
const argLen = args.length; | ||
|
||
if (argLen !== 0) { | ||
return Promise.reject(new RangeError(`Expected no arguments, but got ${argLen} argument${ | ||
argLen === 1 ? '' : 's' | ||
}.`)); | ||
} | ||
|
||
return npmCliDir().then(dirPath => { | ||
return require(join(dirPath, './package.json')).version; | ||
return require(join(dirPath, 'package.json')).version; | ||
}); | ||
}; |
Oops, something went wrong.