# cmd-shim

> Used in npm for command line application support

Latest version **9.0.2** (published 2026-06-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install cmd-shim
pnpm add cmd-shim
yarn add cmd-shim
bun add cmd-shim
```

## Health

**Score 68/100 (B)** — status: active.

Positive: has types package; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 9.0.2 |
| Published | 2026-06-19 |
| First published | 2013-03-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/cmd-shim) |
| Module format | CommonJS |
| Node | ^22.22.2 \|\| ^24.15.0 \|\| >=26.0.0 |
| Dependencies | 0 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 81 |
| Author | GitHub Inc. |
| Maintainers | saquibkhan, npm-cli-ops, reggi, owlstronaut |

## Links

- npm: https://www.npmjs.com/package/cmd-shim
- Repository: https://github.com/npm/cmd-shim
- Homepage: https://github.com/npm/cmd-shim#readme
- Issues: https://github.com/npm/cmd-shim/issues
- npm.io page: https://npm.io/package/cmd-shim

## Recent versions

- 9.0.2 (latest) — 2026-06-19
- 9.0.1 — 2026-06-08
- 9.0.0 — 2026-05-08
- 8.0.0 — 2025-10-22
- 7.0.0 — 2024-08-26
- 6.0.3 — 2024-05-04
- 6.0.2 — 2023-10-18
- 6.0.1 — 2022-12-13
- 6.0.0 — 2022-10-11
- 5.0.0 — 2022-04-05
- 4.1.0 — 2021-02-05
- 4.0.2 — 2020-07-11
- 4.0.1 — 2020-01-27
- 4.0.0 — 2020-01-27
- 3.0.3 — 2019-08-21
- … 12 more at https://npm.io/package/cmd-shim/versions

## README

# 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](https://img.shields.io/github/actions/workflow/status/npm/cmd-shim/ci.yml?branch=main)](https://github.com/npm/cmd-shim)
[![Dependency Status](https://img.shields.io/librariesio/github/npm/cmd-shim)](https://libraries.io/npm/cmd-shim)
[![npm version](https://img.shields.io/npm/v/cmd-shim.svg)](https://www.npmjs.com/package/cmd-shim)

## 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.

```javascript
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.

---
_Source: https://npm.io/package/cmd-shim · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
