"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/read-cmd-shim/README.md" (11 Apr 2017, 1142 Bytes) of package /windows/misc/atom-windows.zip:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.


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


``` var readCmdShim = require('read-cmd-shim')

readCmdShim('/path/to/shim.cmd', function (er, destination) { … })

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

readCmdShim(path, callback)

Reads the cmd-shim located at path and calls back 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.


Same as above but synchronous. Errors are thrown.