Registry / http-networking / typescript-http-client

typescript-http-client

JSON →
library0.10.5jsnpmunverified

A lightweight Promise-based HTTP client for TypeScript with a filter chain architecture, version 0.10.5. Released infrequently (last update 2020). Differentiates from axios/fetch by offering a middleware-like filter system for request/response transformation, caching, or logging. Ships TypeScript types. Supports typed responses via generics. Not actively maintained; consider alternatives like ky or axios for modern apps.

npm install typescript-http-client
INSTALL
IMPORT
SIG · TYPESCRIPT-HTTP-CL
T
typescript-http-client
http-networkingjavascriptv0.10.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

newHttpClient
import { newHttpClient } from 'typescript-http-client'
import newHttpClient from 'typescript-http-client'
Named export, not default.
Request
import { Request } from 'typescript-http-client'
const Request = require('typescript-http-client').Request
ESM-only; can also use CJS destructure but prefer named imports.
Response
import { Response } from 'typescript-http-client'
Used for type annotations; no common alternative import.
Filter
import { Filter } from 'typescript-http-client'
Interface for custom filters.
FilterChain
import { FilterChain } from 'typescript-http-client'
Used in filter implementation.

Creates an HTTP client, builds a GET request, and executes it with typed text response.

import { Request, newHttpClient } from 'typescript-http-client'; const client = newHttpClient(); const request = new Request('https://jsonplaceholder.typicode.com/todos/1', { responseType: 'text' }); client.execute<string>(request).then(response => { console.log(response); }).catch(err => { console.error(err); });
Debug
Known issues
gotchaFilter chain: Filters must call filterChain.doFilter() or the request hangs.
fix
Ensure each filter's doFilter method awaits or returns filterChain.doFilter(call).
affects: >=0.0.0
breakingVersion 0.10.x renamed newClient() to newHttpClient().
fix
Use newHttpClient() instead of newClient().
affects: >=0.10.0
deprecatedPackage not updated since 2020; may have unpatched security issues.
fix
Consider migrating to a maintained alternative like ky or axios.
affects: >=0.0.0
gotchaThe Request constructor's responseType defaults to 'json'; set to 'text' for string responses.
fix
Explicitly set { responseType: 'text' } for non-JSON responses.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: client.execute is not a function
Old API: newClient() was renamed to newHttpClient() in v0.10.
fix
Use newHttpClient() to create the client instance.
Error: Filter must call filterChain.doFilter
A filter's doFilter did not invoke filterChain.doFilter() causing infinite wait.
fix
Add 'const response = await filterChain.doFilter(call); return response;' in each filter.
Property 'body' does not exist on type 'Response<U>'
Misunderstanding of Response type: body property exists but may be typed incorrectly.
fix
Ensure generic parameter matches expected response body type.
Upgrade
Version history
0.10.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
typescript-http-client — npm install typescript-http-client · libregistry