strip-assertions
v1.0.7
Published
Strip debug assertions from JavaScript code
Downloads
625
Maintainers
Readme
strip-assertions
Strip debug assertions from JavaScript code.
Strip assertions using node:assert from any number of JavaScript source code
files. Skips test files automatically.
Install
npm install --global strip-assertionsUsage
CLI
strip-assertions file-1.js file-2.jsFor more information
strip-assertions --helpAPI
import { stripAssertions } from "strip-assertions";
stripAssertions(`
import assert from "assert";
let arr = [1, 2, 3];
assert(arr.length > 0);
`);
//=> "let arr = [1, 2, 3];"Related
License
The source code is licensed under the Apache-2.0 license, see LICENSE for
the full license text.
