H5-contact/node_modules/strip-literal
whitechiina 753b079311 first commit 2026-08-20 15:54:28 +08:00
..
dist first commit 2026-08-20 15:54:28 +08:00
node_modules/js-tokens first commit 2026-08-20 15:54:28 +08:00
LICENSE first commit 2026-08-20 15:54:28 +08:00
README.md first commit 2026-08-20 15:54:28 +08:00
package.json first commit 2026-08-20 15:54:28 +08:00

README.md

strip-literal

NPM version

Strip comments and string literals from JavaScript code. Powered by js-tokens.

Usage

import { stripLiteral } from 'strip-literal'

stripLiteral('const foo = `//foo ${bar}`') // 'const foo = `       ${bar}`'

Comments, string literals will be replaced by spaces with the same length to keep the source map untouched.

Sponsors

License

MIT License © 2022 Anthony Fu