Registry / devops / agentch

agentch

JSON →
library0.5.2jsnpmunverified

agentch v0.5.2 is a lightweight HTTP request agent built on the Fetch API, written in TypeScript. It provides a minimal abstraction over fetch for making requests with support for interceptors, timeouts, and custom headers. Released under an MIT license, it is intended primarily for Node.js environments but can work in browsers that support fetch. The library is still in early development (0.x) with an unstable API and known missing features like race condition handling, caching, and retry logic. It differentiates from axios and superagent by relying entirely on the native fetch, thus having no dependencies, but this also means it lacks Node.js-specific features like HTTP/2 or agent handling currently. With weekly updates, it targets developers needing a tiny, typed fetch wrapper.

npm install agentch
INSTALL
IMPORT
SIG · AGENTCH
A
agentch
devopsjavascriptv0.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Agent
import { Agent } from 'agentch'
const Agent = require('agentch')
ESM-only package; use import syntax. Agent is the main class.
createAgent
import { createAgent } from 'agentch'
import createAgent from 'agentch'
createAgent is a named export, not default. Use curly braces.
AgentConfig
import type { AgentConfig } from 'agentch'
import { AgentConfig } from 'agentch'
AgentConfig is a TypeScript type; use import type for more efficient compiled output.

Creates an Agent instance with base URL, timeout, and custom headers, then performs a GET request with query parameters.

import { Agent } from 'agentch'; const agent = new Agent({ baseURL: 'https://api.example.com', timeout: 5000, headers: { 'Content-Type': 'application/json', }, }); async function main() { try { const response = await agent.get('/data', { params: { id: 123 }, }); console.log('Status:', response.status); const body = await response.json(); console.log('Body:', body); } catch (error) { console.error('Request failed:', error); } } main();
Debug
Known issues
breakingagentch is v0.5.2 and under active development; API breaking changes may occur between minor versions.
fix
Pin to exact version in package.json (e.g., "agentch": "0.5.2") and review changelog before upgrading.
affects: <1.0.0
gotchaThe Agent class uses native fetch, which does not support Node.js specific agent options (e.g., keepAlive, ca certificates) out of the box.
fix
Use Node's undici or node-fetch polyfill and configure via fetch options if needed. The library does not expose a way to pass custom fetch implementation yet.
affects: *
deprecatedThe package does not have built-in retry or caching mechanisms; implementing your own may conflict with future versions.
fix
Currently no replacement; consider wrapping agent calls with retry logic from a library like 'p-retry' or 'retry-axios' and treat as temporary.
affects: *
gotchaTypeScript types are bundled but may not be fully accurate for edge cases (e.g., response body parsing).
fix
Always verify type assertions manually or use 'as' casts for response data if needed.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'agentch'
Package not installed or not in node_modules.
fix
Run `npm install agentch` or ensure package.json includes "agentch": "^0.5.2" and run `npm install`.
TypeError: agent.get is not a function
Importing Agent incorrectly or using an older version that doesn't have get method.
fix
Ensure you are using v0.5.2 and import correctly: `import { Agent } from 'agentch'`. Check your agentch version: `npm ls agentch`.
ERR_INVALID_ARG_TYPE: The "url" argument must be of type string
Passing undefined or non-string to the Agent constructor baseURL option.
fix
Always provide a valid string for baseURL or omit it and pass full URLs in request methods.
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
34
OpenAI (training)
1
Resources
agentch — npm install agentch · libregistry