finds.dev

mikeal/bent

Functional JS HTTP client (Node.js & Fetch) w/ async await

View on GitHub

★ 2,189JavaScriptupdated Dec 2022

// the take

bent is a minimal HTTP client for Node.js and browsers built around partial application — you configure a client once with method, base URL, accepted status codes, and response format, then call it repeatedly. The mental model is functional rather than object-oriented, which makes it easy to define named clients like `getJSON` or `postForm` up front. It's aimed at developers who find axios or node-fetch's default API too verbose for straightforward request patterns.

The partial application pattern is genuinely useful: declaring `const getJSON = bent('https://api.example.com', 'json', 200)` once and reusing it is cleaner than constructing request objects repeatedly. Bundle size is tiny — 1k gzipped with no external dependencies, which matters when you're shipping to browsers. Status code enforcement as a first-class constraint (non-200 throws by default) means you can't silently swallow HTTP errors the way raw fetch lets you. The API surface is small enough to read entirely in five minutes.

Abandoned since December 2022 — no commits, no maintenance. Node.js now ships `fetch` natively, which removes most of bent's browser parity argument, and the ecosystem has largely moved to that or undici. The positional option API (figuring out which arg is the method vs. the base URL by inspecting content) feels clever at first but makes TypeScript and autocomplete unhelpful — there are no typed overloads. Retry logic, timeouts, and interceptors are completely absent with no extension point, so any real production use ends up wrapping it anyway. At that point you might as well write the wrapper around native fetch.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
2,189
Forks
83
Language
JavaScript
Last commit
20 Dec 2022

// nearby

If bent isn't quite it.

All repos →