Socket
Socket
Sign inDemoInstall

read-cmd-shim

Package Overview
Dependencies
0
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

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.


Version published
Weekly downloads
2.7M
decreased by-17.36%
Maintainers
5
Install size
5.04 kB
Created
Weekly downloads
 

Changelog

Source

4.0.0 (2022-10-10)

⚠️ BREAKING CHANGES

  • read-cmd-shim is now compatible with the following semver range for node: ^14.17.0 || ^16.13.0 || >=18.0.0

Features

  • 8a9dfed #35 postinstall for dependabot template-oss PR (@lukekarrys)

Readme

Source

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.

FAQs

Last updated on 14 Oct 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc