GitShow/antfu/strip-literal
antfu

strip-literal

Strip comments and string literals from JavaScript code

by antfu
Star on GitHubForknpm

TypeScript

88 stars11 forks7 contributorsActive · 3w agoSince 2022v4.0.0MIT

Meet the team

See all 7 on GitHub →
antfu
antfu52 contributions
Eazash
Eazash1 contribution
hi-ogawa
hi-ogawa1 contribution
noootwo
noootwo1 contribution
sheremet-va
sheremet-va1 contribution
YIngChenIt
YIngChenIt1 contribution
sapphi-red
sapphi-red1 contribution

Languages

View on GitHub →
TypeScript98.4%
JavaScript1.6%

Commit activity

Last 12 weeks · 4 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template✓PR Template

Recent fixes

View closed PRs →
gameroman
go esm only?ClosedIssue

I think it's a good idea to release a new esm-only version :)

gameroman · 3w ago
Eazash
perf: avoid creating tokens list on `stripLiteral`MergedPR

Description When investigating an OOM error during build of a nuxt 3 app, I found that internally calls and returns only the result. This meant that the list of tokens was being generated but unused. This PR is a refactor to avoid creating the array when is called. When bechmarking I've noticed anywhere between same speed to a 20% increase. I do have to note that depending on warmup and run counts, these values do vary significantly. Additional context I haven't been able to direclty measure the decreased memory usage of from the effect of this PR. I have tried capturing heap profiles and snapshots but can't really seem to capture the change. The best indicator I could come up with is observing the process' Resident Set Size. For the small script below, this PR introduced an almost 2MB decrease (from 83.11MB to 81.14MB) on my machine. Small memory test script

Eazash · 11mo ago
noootwo
fix: upgrade `js-tokens` to fix incorrect strippingMergedPR

Description upgrade to fix incorrect stripping of regex expressions Linked Issues resolve #8

noootwo · 1y ago
Structured data for AI agents

Repository: antfu/strip-literal. Description: Strip comments and string literals from JavaScript code Stars: 88, Forks: 11. Primary language: TypeScript. Languages: TypeScript (98.4%), JavaScript (1.6%). License: MIT. Latest release: v4.0.0 (3w ago). Open PRs: 0, open issues: 0. Last activity: 3w ago. Community health: 85%. Top contributors: antfu, Eazash, hi-ogawa, noootwo, sheremet-va, YIngChenIt, sapphi-red.

·@ofershap

Replace github.com with gitshow.dev