shescape

simple shell escape library

v1 is deprecated and will no longer be supported after 2023-12-06
Last updated 2 years ago by ericcornelissen .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install shescape 
SYNC missed versions from official npm registry.

Shescape

GitHub Actions Coverage Report npm Package

A simple shell escape library for JavaScript. Use it to escape user-controlled inputs to shell commands to prevent shell injection.

Quick links: npm | Source code | License | Changelog | Security

Features

  • Advanced shell detection
  • Lightweight
  • Supports MacOS, Linux, and Windows
  • Prevents environment variable access

Shells

The following shells are officially supported and extensively tested. It is recommended to only use shells found in this list.

If you want to use Shescape with another shell you can request it on GitHub by opening an issue.

Usage

Install

  1. Install shescape:

    npm install shescape
    
  2. Import shescape:

    import { Shescape } from "shescape";
    
  3. Initialize Shescape.

    const shescape = new Shescape(/* options */);
    
  4. Use shescape.

Migrating from v1

View the migration guidelines for help.

Recipes

View the recipes for examples of how to use Shescape.

API

View the API documentation of Shescape.

Testing

View the testing documentation for how to test code that uses Shescape.

Further Reading

Read the tips for additional ways to protect against shell injection.

License

The source code is licensed under the MPL-2.0 license, see LICENSE for the full license text. The documentation text is licensed under CC BY-SA 4.0; code snippets under the MIT license.

Supporting code, such a scripts and tests, is generally licensed under the MIT license. However, individual files may be licensed differently depending on the intend or origin.

The license under which a given file is available can always be found in the file's banner comment.

Current Tags

  • 2.1.0                                ...           latest (a year ago)
  • 2.0.0-rc3                                ...           next (a year ago)

50 Versions

  • 2.1.0                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 2.0.0-rc3 [deprecated]           ...           a year ago
  • 1.7.4 [deprecated]           ...           a year ago
  • 2.0.0-rc2 [deprecated]           ...           a year ago
  • 1.7.3 [deprecated]           ...           a year ago
  • 2.0.0-rc1 [deprecated]           ...           a year ago
  • 1.7.2 [deprecated]           ...           a year ago
  • 1.7.1 [deprecated]           ...           a year ago
  • 1.7.0 [deprecated]           ...           a year ago
  • 1.6.7 [deprecated]           ...           2 years ago
  • 1.6.6 [deprecated]           ...           2 years ago
  • 1.6.5 [deprecated]           ...           2 years ago
  • 1.6.4 [deprecated]           ...           2 years ago
  • 1.6.3 [deprecated]           ...           2 years ago
  • 1.6.2 [deprecated]           ...           2 years ago
  • 1.6.1 [deprecated]           ...           2 years ago
  • 1.6.0 [deprecated]           ...           2 years ago
  • 1.5.10 [deprecated]           ...           2 years ago
  • 1.5.9 [deprecated]           ...           2 years ago
  • 1.5.8 [deprecated]           ...           2 years ago
  • 1.5.7 [deprecated]           ...           2 years ago
  • 1.5.6 [deprecated]           ...           2 years ago
  • 1.5.5 [deprecated]           ...           3 years ago
  • 1.5.4 [deprecated]           ...           3 years ago
  • 1.5.3 [deprecated]           ...           3 years ago
  • 1.5.2 [deprecated]           ...           3 years ago
  • 1.5.1 [deprecated]           ...           3 years ago
  • 1.5.0 [deprecated]           ...           3 years ago
  • 1.4.0 [deprecated]           ...           3 years ago
  • 1.3.3 [deprecated]           ...           3 years ago
  • 1.3.2 [deprecated]           ...           3 years ago
  • 1.3.1 [deprecated]           ...           3 years ago
  • 1.3.0 [deprecated]           ...           3 years ago
  • 1.2.1 [deprecated]           ...           4 years ago
  • 1.2.0 [deprecated]           ...           4 years ago
  • 1.1.3 [deprecated]           ...           4 years ago
  • 1.1.2 [deprecated]           ...           4 years ago
  • 1.1.1 [deprecated]           ...           4 years ago
  • 1.1.0 [deprecated]           ...           4 years ago
  • 1.0.0 [deprecated]           ...           4 years ago
  • 0.4.1 [deprecated]           ...           4 years ago
  • 0.4.0 [deprecated]           ...           4 years ago
  • 0.3.1 [deprecated]           ...           4 years ago
  • 0.3.0 [deprecated]           ...           4 years ago
  • 0.2.1 [deprecated]           ...           4 years ago
  • 0.2.0 [deprecated]           ...           4 years ago
  • 0.1.0 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 11
Last Day 0
Last Week 11
Last Month 0
Dependencies (1)
Dev Dependencies (26)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |