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

2.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i strip-literal

Weekly Downloads

3,983,129

Version

2.1.0

License

MIT

Unpacked Size

11.3 kB

Total Files

8

Last publish

Collaborators

  • antfu