shescape
TypeScript icon, indicating that this package has built-in type declarations

1.6.6 • Public • Published

Shescape

GitHub Actions Coverage Report Mutation 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

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 * as shescape from "shescape";
  3. Use shescape.

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.


Please open an issue if you found a mistake or if you have a suggestion for how to improve the documentation.

Install

npm i shescape

DownloadsWeekly Downloads

5,108

Version

1.6.6

License

MPL-2.0

Unpacked Size

117 kB

Total Files

20

Last publish

Collaborators

  • ericcornelissen