cd /news/developer-tools/show-hn-tiny-and-csp-safe-expression… · home topics developer-tools article
[ARTICLE · art-63536] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Show HN: Tiny and CSP-safe expression language for JavaScript

Robin van der Vleuten released xprsn, a 1.2 KB gzipped expression language library for JavaScript that is CSP-safe and designed for runtime evaluation of business logic. The package, extracted from a closed-source project, supports custom function extensions and uses a precedence climbing parser.

read1 min views1 publishedJul 17, 2026

For a feature on project I was working on, I needed a simple way to have some business logic like "expressions" evaluated at runtime. I only found a handfull packages either very old (e.g. expr-eval) or very Math oriented (e.g. Mathjs). I wanted a way to have a very simple core "compile then evaluate" package that I could easily extend with custom functions needed for the project (so in theory I could support a full Math suite).

The result is this tiny xprsn package, and is somewhere around 1.2kb gzipped, extracted from the closed-source project. See https://github.com/robinvdvleuten/xprsn.

Not gonna lie here, as it is mostly Fable5 effort (you probably will notice by the terse, not very human-readable precedence climbing parser. But the point was to get a tiny working package, not some heavy brain exercise of myself :)

Despite some anti AI-slop people on HN, I wanted to share it here as I still think it would be useful to others.

Comments URL: [https://news.ycombinator.com/item?id=48945983](https://news.ycombinator.com/item?id=48945983)

Points: 1

── more in #developer-tools 4 stories · sorted by recency
── more on @robin van der vleuten 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-tiny-and-csp…] indexed:0 read:1min 2026-07-17 ·