top | item 44315944

Show HN: Voft – VAVR‑style objects for Typscript

2 points| reeeeee | 8 months ago |github.com

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!

discuss

order

No comments yet.