node/deps/npm/node_modules/cmd-shim
claudiahdz a7c7c703af
deps: upgrade npm to 6.13.1
PR-URL: https://github.com/nodejs/node/pull/30533
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-11-20 19:16:47 -05:00
..
lib deps: upgrade npm to 6.13.1 2019-11-20 19:16:47 -05:00
index.js deps: update npm to 6.11.3 2019-09-17 18:51:21 -07:00
LICENSE deps: update npm to 6.11.3 2019-09-17 18:51:21 -07:00
package.json deps: update npm to 6.11.3 2019-09-17 18:51:21 -07:00
README.md deps: update npm to 6.11.3 2019-09-17 18:51:21 -07:00

cmd-shim

The cmd-shim used in npm to create executable scripts on Windows, since symlinks are not suitable for this purpose there.

On Unix systems, you should use a symbolic link instead.

Build Status Dependency Status NPM version

Installation

npm install cmd-shim

API

cmdShim(from, to, cb)

Create a cmd shim at to for the command line program at from. e.g.

var cmdShim = require('cmd-shim');
cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {
  if (err) throw err;
});

cmdShim.ifExists(from, to, cb)

The same as above, but will just continue if the file does not exist. Source:

function cmdShimIfExists (from, to, cb) {
  fs.stat(from, function (er) {
    if (er) return cb()
    cmdShim(from, to, cb)
  })
}