Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/commands/bin.js')
-rw-r--r--lib/commands/bin.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/commands/bin.js b/lib/commands/bin.js
new file mode 100644
index 000000000..9a894f3bb
--- /dev/null
+++ b/lib/commands/bin.js
@@ -0,0 +1,24 @@
+const envPath = require('../utils/path.js')
+const BaseCommand = require('../base-command.js')
+
+class Bin extends BaseCommand {
+ static get description () {
+ return 'Display npm bin folder'
+ }
+
+ static get name () {
+ return 'bin'
+ }
+
+ static get params () {
+ return ['global']
+ }
+
+ async exec (args) {
+ const b = this.npm.bin
+ this.npm.output(b)
+ if (this.npm.config.get('global') && !envPath.includes(b))
+ console.error('(not in PATH env variable)')
+ }
+}
+module.exports = Bin