Comparing version 0.1.0 to 0.2.0
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
20174
6
26
4