# shell-escape

> Escape and stringify an array of arguments to be executed on the shell

Latest version **0.2.0** (published 2015-02-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install shell-escape
pnpm add shell-escape
yarn add shell-escape
bun add shell-escape
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-02-11 |
| First published | 2013-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/shell-escape) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 70 |
| Maintainers | bahamas10, xorax |
| Keywords | shell, escape, bash, escapeshellarg |

## Links

- npm: https://www.npmjs.com/package/shell-escape
- Repository: https://github.com/xxorax/node-shell-escape
- Issues: https://github.com/xxorax/node-shell-escape/issues
- npm.io page: https://npm.io/package/shell-escape

## Recent versions

- 0.2.0 (latest) — 2015-02-11
- 0.1.0 — 2014-02-10
- 0.0.1 — 2013-08-29
- 0.0.0 — 2013-06-06

## README

shell-escape
============

Escape and stringify an array of arguments to be executed on the shell

Install
-------

    npm install shell-escape

Example
-------

### simple

``` js
var shellescape = require('shell-escape');

var args = ['curl', '-v', '-H', 'Location;', '-H', 'User-Agent: dave#10', 'http://www.daveeddy.com/?name=dave&age=24'];

var escaped = shellescape(args);
console.log(escaped);
```

yields

```
curl -v -H 'Location;' -H 'User-Agent: dave#10' 'http://www.daveeddy.com/?name=dave&age=24'
```

A command suitable for being executed by the shell

### advanced

``` js
var shellescape = require('shell-escape');

var args = ['echo', 'hello!', 'how are you doing $USER', '"double"', "'single'"];

var escaped = shellescape(args);
console.log(escaped);
```

yields

```
echo 'hello!' 'how are you doing $USER' '"double"' \''single'\'
```

and when run on the shell

```
$ echo 'hello!' 'how are you doing $USER' '"double"' \''single'\'
hello! how are you doing $USER "double" 'single'
```

License
-------

MIT

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