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

2.1.1 • 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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.1668,147latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.1668,147
2.1.01,462,318
2.0.0313,744
1.3.01,054,354
1.2.0793
1.1.0368
1.0.1168,206
1.0.018,622
0.4.255,161
0.4.1731
0.4.02,560
0.3.096
0.2.00
0.1.01

Package Sidebar

Install

npm i strip-literal

Weekly Downloads

3,745,101

Version

2.1.1

License

MIT

Unpacked Size

11.3 kB

Total Files

8

Last publish

Collaborators

  • antfu