Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Voft – VAVR‑style objects for Typscript (github.com/artus)
2 points by reeeeee on June 19, 2025 | hide | past | favorite
Hi HN,

Some time ago I released voft (Various Objects For TypeScript), a tiny utility library that brings some of the ergonomics of the Java VAVR functional library to TypeScript/JavaScript.

Why?

I missed VAVR's Try monad when writing Node back‑ends and React front‑ends: it lets you chain calls without drowning in try/catch blocks.

I wanted an async‑aware variant (AsyncTry) for promise chains.

Existing FP libs (fp‑ts, purify, etc.) cover similar ground but felt heavier for small projects, and I also wanted to challenge myself.

What's inside?

- Try – wrap any sync code, then .map, .flatMap, .recover…

- AsyncTry – same, but for Promise‑based flows; awaitable and chainable.

- Optional – lightweight Maybe.

- Either<L, R> – success/failure container with ergonomic helpers.

Early days – the API is still settling and there are probably bugs. I'd love feedback, issues and PRs!

Thanks for reading!



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: