Shellwords
Shellwords provides functions to manipulate strings according to the word parsing rules of the UNIX Bourne shell. It is based on the Ruby module of the same name.
Installation
With npm:
npm install shellwords
With Yarn:
yarn add shellwords
API
Shellwords exports the following functions, shown here in the TypeScript declaration file format.
export declare const split: (line?: string) => string[];
export declare const escape: (str?: string) => string;
Example
import { escape, split } from "shellwords";
split("foo 'bar baz'");
escape("What's up, yo?");
Legal
shellwords is released under the MIT license. See LICENSE
.