MCPcopy Index your code
hub / github.com/antfu/strip-literal

github.com/antfu/strip-literal @v3.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.0 ↗ · + Follow
10 symbols 40 edges 19 files 0 documented · 0% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Extension points exported contracts — how you extend this code

StripLiteralOptions (Interface)
(no doc)
src/types.ts

Core symbols most depended-on inside this repo

executeWithVerify
called by 23
test/utils.ts
stripLiteralFromToken
called by 2
src/js-tokens.ts
optionsWithDefaults
called by 2
src/js-tokens.ts
stripLiteral
called by 2
src/js-tokens.ts
getTestData
called by 1
test/fixtures/issue4.js
getTestData
called by 1
test/fixtures/issue4.output.js
stripLiteralDetailed
called by 1
src/js-tokens.ts
_sfc_ssrRender
called by 0
test/fixtures/issue4.js

Shape

Function 9
Interface 1

Languages

TypeScript100%

Modules by API surface

src/js-tokens.ts4 symbols
test/fixtures/issue4.output.js2 symbols
test/fixtures/issue4.js2 symbols
test/utils.ts1 symbols
src/types.ts1 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add strip-literal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact