Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

read-cmd-shim

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-cmd-shim

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

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5M
increased by2.45%
Maintainers
0
Weekly downloads
 
Created
Source

read-cmd-shim

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

Usage

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.

readCmdShim.sync(path)

Same as above but synchronous. Errors are thrown.

FAQs

Package last updated on 14 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc