# any-shell-escape

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

Latest version **0.1.1** (published 2014-02-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-02-27 |
| First published | 2014-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Maintainers | boazy |

## Links

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

## Recent versions

- 0.1.1 (latest) — 2014-02-27
- 0.1.0 — 2014-02-23

## README

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

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

Install
-------

    npm install any-shell-escape

Example
-------

### simple

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

var args = ['curl', '-v', '-H', 'Location;', '-H', "User-Agent: FooBar's so-called \"Browser\"", 'http://www.daveeddy.com/?name=dave&age=24'];

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

yields (on POSIX shells):

```
curl -v -H 'Location;' -H 'User-Agent: FoorBar'"'"'s so-called "Browser"' 'http://www.daveeddy.com/?name=dave&age=24'
```

or (on Windows):

```
curl -v -H "Location;" -H "User-Agent: FooBar's so-called ""Browser""" "http://www.daveeddy.com/?name=dave&age=24"
```

Which is suitable for being executed by the shell.

### Advanced Usage:

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

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

var escaped = 'echo ' + shellescape.msg(args);
console.log(escaped);
```

yields (on POSIX shells):

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

or (on Windows, which doesn't support escaping echoed messages):

```
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/any-shell-escape · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
