GitShow/antfu/strip-literal
antfu

strip-literal

Strip comments and string literals from JavaScript code

by antfu
Star on GitHubForknpm

TypeScript

89 stars11 forks7 contributorsQuiet · 9mo agoSince 2022MIT

Meet the team

See all 7 on GitHub →
antfu
antfu48 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

Recent fixes

View closed PRs →
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 · 9mo 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
noootwo
Incorrect stripping of strings with the `a[/` syntax regular expressionClosedIssue

Additional context This is a upstream bug caused by , I have raised the issue in its repository, and the author has submitted a fix PR. https://github.com/lydell/js-tokens/pull/53 After it release the new version, I will submit a PR to update the dependency.

noootwo · 1y ago
Structured data for AI agents

Repository: antfu/strip-literal. Description: Strip comments and string literals from JavaScript code Stars: 89, Forks: 11. Primary language: TypeScript. License: MIT. Open PRs: 0, open issues: 0. Last activity: 9mo ago. Top contributors: antfu, Eazash, hi-ogawa, noootwo, sheremet-va, YIngChenIt, sapphi-red.

·@ofershap

Replace github.com with gitshow.dev