read-cmd-shim
Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.
Last updated 2 months ago by npm-cli-ops .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install read-cmd-shim 
SYNC missed versions from official npm registry.

read-cmd-shim

Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.

Usage

const readCmdShim = require('read-cmd-shim')

readCmdShim('/path/to/shim.cmd').then(destination => {
  …
})

const destination = readCmdShim.sync('/path/to/shim.cmd')

readCmdShim(path) -> Promise

Reads the cmd-shim located at path and resolves with the relative path that the shim points at. Consider this as roughly the equivalent of fs.readlink.

This can read both .cmd style that are run by the Windows Command Prompt and Powershell, and the kind without any extension that are used by Cygwin.

This can return errors that fs.readFile returns, except that they'll include a stack trace from where readCmdShim was called. Plus it can return a special ENOTASHIM exception, when it can't find a cmd-shim in the file referenced by path. This should only happen if you pass in a non-command shim.

readCmdShim.sync(path)

Same as above but synchronous. Errors are thrown.

Current Tags

  • 5.0.0                                ...           latest (2 months ago)

11 Versions

  • 5.0.0                                ...           2 months ago
  • 4.0.0                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Downloads
Total 4
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE