Socket
Socket
Sign inDemoInstall

shescape

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shescape - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

4

CHANGELOG.md

@@ -12,2 +12,6 @@ # Changelog

## [0.2.0] - 2020-11-07
- Add support for escaping of double quotes on Windows.
## [0.1.0] - 2020-11-06

@@ -14,0 +18,0 @@

11

index.js

@@ -1,5 +0,8 @@

function escapeShellArg(arg) {
return arg.replace(/'/g, `'\\''`);
}
const os = require("os");
module.exports = escapeShellArg;
const main = require("./src/main.js");
module.exports = function (arg) {
const platform = os.platform();
return main.escapeShellArgByPlatform(arg, platform);
};
{
"name": "shescape",
"version": "0.1.0",
"version": "0.2.0",
"description": "simple shell escape library",

@@ -9,4 +9,4 @@ "homepage": "https://github.com/ericcornelissen/shescape#readme",

"scripts": {
"format": "prettier --write ./**/*.{js,md}",
"lint": "prettier --check ./**/*.{js,md}",
"format": "prettier --write ./**/*.{js,md,yml}",
"lint": "prettier --check ./**/*.{js,md,yml}",
"test": "mocha"

@@ -34,7 +34,8 @@ },

"mocha": "^8.2.0",
"prettier": "^1.19.1"
"prettier": "^2.1.2",
"sinon": "^9.2.1"
},
"engines": {
"node": ">=10.12.0"
"node": ">=10.13.0"
}
}
# Shescape
[![GitHub Actions][ci-image]][ci-url]
[![NPM Package][npm-image]][npm-url]
A simple shell escape library. Use it to escape user-specified inputs to shell

@@ -19,1 +22,5 @@ commands to prevent [shell injection].

[shell injection]: https://portswigger.net/web-security/os-command-injection
[ci-url]: https://github.com/ericcornelissen/shescape/actions?query=workflow%3A%22Test+and+Lint%22+branch%3Amain
[ci-image]: https://github.com/ericcornelissen/shescape/workflows/Test%20and%20Lint/badge.svg
[npm-url]: https://www.npmjs.com/package/shescape
[npm-image]: https://img.shields.io/npm/v/shescape.svg
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc