JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5872848
  • Score
    100M100P100Q205108F
  • License MIT

Used in npm for command line application support

Package Exports

  • cmd-shim

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cmd-shim) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cmd-shim

The cmd-shim used in npm. Currently npm has this code inlined. It wasn not originally written by me; I simply copied it from the npm repository.

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)
  })
}

Logging

By default, npmlog is used for logging. Log messages are written by default if it fails to write to the output directory. You can disable the logging by calling:

require('npmlog').level('silent');

License

MIT