# shellwords-ts

> JS lib with TS typings to manipulate strings according to the word parsing rules of the UNIX Bourne shell.

Latest version **3.0.1** (published 2022-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install shellwords-ts
pnpm add shellwords-ts
yarn add shellwords-ts
bun add shellwords-ts
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2022-11-23 |
| First published | 2019-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Marques Lee |
| Maintainers | marques- |

## Links

- npm: https://www.npmjs.com/package/shellwords-ts
- Repository: https://github.com/marques-work/shellwords
- Issues: https://github.com/marques-work/shellwords/issues
- npm.io page: https://npm.io/package/shellwords-ts

## Recent versions

- 3.0.1 (latest) — 2022-11-23
- 3.0.0 — 2020-01-30
- 2.0.4 — 2019-08-16
- 2.0.3 — 2019-08-16
- 2.0.2 — 2019-07-10
- 2.0.1 — 2019-05-13
- 2.0.0 — 2019-05-12
- 1.0.0 — 2019-04-30

## README

# Shellwords-TS

[![Build Status](https://github.com/marques-work/shellwords/actions/workflows/build-test.yaml/badge.svg)](https://github.com/marques-work/shellwords/actions/workflows/build-test.yaml)

A JavaScript port of the [Ruby module of the same name](https://ruby-doc.org/stdlib-3.1.2/libdoc/shellwords/rdoc/Shellwords.html), with TypeScript typings. Shellwords provides functions to manipulate strings according to the word parsing rules of the UNIX Bourne shell. Originally forked from [jimmycuadra/shellwords](https://github.com/jimmycuadra/shellwords), this package is updated to be at parity with a modern reference implementation (Ruby 3.1.2 at the time of writing) and implements `Shellwords.join()`, which was missing from the original package. The goal of this is to maintain parity with the Ruby `Shellwords` module, so if there is a discrepancy, please file a [bug](https://github.com/marques-work/shellwords/issues/new) (or even better, a [PR](https://github.com/marques-work/shellwords/pull/new/master)).

## Installation

Add "shellwords-ts" to your `package.json` file and run `npm install`.

## Example

```javascript
import Shellwords from "shellwords-ts";

Shellwords.split("foo 'bar baz'"); // ["foo", "bar baz"]
Shellwords.escape("What's up?"); // "What\\'s\\ up\\?"
Shellwords.join(["find", "~/Library/Application Support", "-name", "*.plist"]); // "find \\~/Library/Application\\ Support -name \\*.plist"

Shellwords.split("foo 'bar baz' quu", (rawPart) => {
  // have access to the chunks of the raw string as it is scanned
});
```

## Breaking changes as of 3.0.0:

- `Shellwords.escape()` no longer escapes `+`; see [this commit in the GitHub Ruby repo](https://github.com/ruby/ruby/commit/43a16c98df392e726040f0331a3e09d00c53d513).

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