Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

shellwords

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

shellwords

Manipulate strings according to the word parsing rules of the UNIX Bourne shell.

    1.0.1latest

Version published
Maintainers
1
Weekly downloads
6,551,471
decreased by-11.02%

Weekly downloads

Changelog

Source

1.0.1

Improvements:

  • Added keywords to package metadata.

Bug fixes:

  • Fixed imports in README example.

Readme

Source

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.

/** * Splits a string into an array of tokens in the same way the UNIX Bourne shell does. * * @param line A string to split. * @returns An array of the split tokens. */ export declare const split: (line?: string) => string[]; /** * Escapes a string so that it can be safely used in a Bourne shell command line. * * @param str A string to escape. * @returns The escaped string. */ export declare const escape: (str?: string) => string;

Example

import { escape, split } from "shellwords"; split("foo 'bar baz'"); // ["foo", "bar baz"] escape("What's up, yo?"); // 'What\\\'s\\ up,\\ yo\\?'

shellwords is released under the MIT license. See LICENSE.

Keywords

FAQs

What is shellwords?

Manipulate strings according to the word parsing rules of the UNIX Bourne shell.

Is shellwords popular?

The npm package shellwords receives a total of 5,240,809 weekly downloads. As such, shellwords popularity was classified as popular.

Is shellwords well maintained?

We found that shellwords demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 01 Feb 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc