Socket
Socket
Sign inDemoInstall

cmd-shim

Package Overview
Dependencies
0
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cmd-shim

Used in npm for command line application support


Version published
Weekly downloads
3.2M
increased by0.73%
Maintainers
5
Install size
11.8 kB
Created
Weekly downloads
 

Package description

What is cmd-shim?

The cmd-shim npm package is designed to create command shims (or symbolic links) on Windows and Unix-like systems for node.js scripts. This allows node.js scripts to be executed as if they were native commands in the user's shell, making it easier to use node.js tools across different platforms without worrying about the underlying differences in how executable scripts are handled.

What are cmd-shim's main functionalities?

Creating command shims

This feature allows the creation of a command shim for a node.js script. The code sample demonstrates how to create a shim for a node.js script located at 'path/to/node-script.js' and place the resulting shim at 'path/to/shim'. This makes the script executable as if it were a native command.

const cmdShim = require('cmd-shim');
cmdShim('path/to/node-script.js', 'path/to/shim', function (err) {
  if (err) throw err;
});

Other packages similar to cmd-shim

Changelog

Source

6.0.2 (2023-10-18)

Bug Fixes

  • 3bdb518 #117 don't assume cygpath is available (#117) (@davhdavh)

Readme

Source

cmd-shim

The cmd-shim used in npm to create executable scripts on Windows, since symlinks are not suitable for this purpose there.

On Unix systems, you should use a symbolic link instead.

Build Status Dependency Status npm version

Installation

npm install cmd-shim

API

cmdShim(from, to) -> Promise

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').then(() => {
  // shims are created!
})

cmdShim.ifExists(from, to) -> Promise

The same as above, but will just continue if the file does not exist.

FAQs

Last updated on 18 Oct 2023

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