Skip to content

Show HN: Voft – VAVR‑style objects for Typscript

github.com/artus
2 pointsreeeeeediscuss
On HN

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!

Comments

No comments yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.