Every request,
under control.
From your first Fetch call to production workflows.
Type safety, streaming and composable resilience in one lightweight client.
import { createClient } from '@npora/request/core'
import { retryPlugin } from
'@npora/request/plugins/retry'
const api = createClient({ baseURL: '/api' })
.use(retryPlugin({ retries: 2 }))
// Less boilerplate. More certainty.
interface User { id: number; name: string }
const user = await api.get<User>('/user')
console.log(user.name)
{ "id": 1, "name": "Npora" }Install. Run. Meet your response.
- Install in a Node.js 22+ project.
npm i @npora/request - Save the example as first-request.mjs.
- Run it from the same project.
node first-request.mjs
This Node.js example uses our public demo API. In a browser app, use your own same-origin /api or a backend that allows your origin through CORS.
Continue with TypeScript and validation ↗import { createClient } from '@npora/request/core'
const api = createClient({
baseURL: 'https://npora.pages.dev/api',
timeout: 5000
})
const user = await api.get('/user')
console.log(user.name)See your requests in action.
Every click sends real requests. Watch failures, recovery and each chunk as it arrives.
Run a scenario to see real responses.Requests 0
| Method / path | Status | Duration |
|---|---|---|
| Actual requests will appear here after you run a scenario. | ||
This demo deliberately triggers failures: schema rejection, timeouts and rate limits are expected. Uploads use a 1 MiB sample (2 MiB maximum per request); uploaded files are not stored.
Less glue code. More building.
The essentials fit together, from a single call to your whole application.
Make boundaries explicit.
Generics describe expectations. Standard Schema validates real data. Errors include stable codes and specific field paths.
Consume data as it arrives.
Consume SSE and NDJSON incrementally, with async iteration, cancellation and backpressure built on web standards.
Compose what you need.
Add retries, authentication, circuit breakers and traffic control through optional plugins around a lightweight core.
A real response. Your next test.
Capture a demo response and turn it into a reusable MockAdapter fixture. Less time writing sample JSON, more time testing what matters.
- 01Record
A real request to the public demo API.
- 02Review
Common credentials and wire headers are filtered.
- 03Replay
Copy a replyOnce fixture into your test.
const mock = new MockAdapter({
record: { adapter: new FetchAdapter() }
})
// Record a response to generate your fixture.Demo data only. Kept in this tab. Nothing is saved to a file.