
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@catalystlabs/typedfetch
Advanced tools
Type-safe HTTP client that doesn't suck - Fetch for humans who have stuff to build
Type-safe HTTP client that doesn't suck - Fetch for humans who have stuff to build
Zero dependencies. Full type safety. Just works.
š¦ npm: @catalystlabs/typedfetch
š Website: typedfetch.dev
š Docs: typedfetch.dev/docs
š» Source: git.catalystlab.cc/caseycollier/TypeFetched
# Using bun
bun add @catalystlabs/typedfetch
# Using npm
npm install @catalystlabs/typedfetch
import { tf } from '@catalystlabs/typedfetch'
// Zero config - just works!
const { data, response } = await tf.get('https://api.github.com/users/github')
console.log(data.name) // Full response data
// With configuration
import { createTypedFetch } from '@catalystlabs/typedfetch'
const client = createTypedFetch({
baseURL: 'https://api.example.com',
headers: {
'Authorization': 'Bearer token'
}
})
const { data, response } = await client.get('/users/123')
import { tf } from '@catalystlabs/typedfetch'
// GET request
const { data, response } = await tf.get('https://api.example.com/users')
// POST request
const { data, response } = await tf.post('https://api.example.com/users', {
body: {
name: 'John Doe',
email: 'john@example.com'
}
})
// PUT request
const { data, response } = await tf.put('https://api.example.com/users/123', {
body: {
name: 'Jane Doe'
}
})
// DELETE request
const { data, response } = await tf.delete('https://api.example.com/users/123')
import { createTypedFetch } from '@catalystlabs/typedfetch'
const client = createTypedFetch({
baseURL: 'https://api.example.com',
headers: {
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
},
timeout: 30000,
// Retry configuration
retry: {
attempts: 3,
delay: 1000,
maxDelay: 10000,
backoff: 'exponential'
},
// Cache configuration
cache: {
enabled: true,
ttl: 300000, // 5 minutes
storage: 'memory' // or 'indexeddb'
}
})
// Or configure the global instance
import { tf } from '@catalystlabs/typedfetch'
tf.configure({
baseURL: 'https://api.example.com',
headers: {
'Authorization': 'Bearer token'
}
})
All methods return a consistent response format:
const { data, response } = await tf.get('/endpoint')
// data: The parsed response body
// response: The full Response object from fetch API
try {
const { data, response } = await tf.get('/users/123')
// Handle success
} catch (error) {
if (error.response) {
// Server responded with error status
console.log(error.response.status)
console.log(error.data)
} else if (error.request) {
// Request was made but no response received
console.log('Network error:', error.message)
} else {
// Something else happened
console.log('Error:', error.message)
}
}
Automatically stops making requests to failing endpoints:
const client = createTypedFetch({
circuitBreaker: {
enabled: true,
failureThreshold: 5,
resetTimeout: 60000 // 1 minute
}
})
Intelligent caching with multiple storage options:
const client = createTypedFetch({
cache: {
enabled: true,
ttl: 300000, // 5 minutes
storage: 'indexeddb', // Persistent storage
respectCacheHeaders: true // Honor HTTP cache headers
}
})
const { data } = await tf.get('/endpoint', {
headers: {
'X-Custom-Header': 'value'
}
})
We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE for details.
TypedFetch: Because life's too short for complex HTTP clients. š
FAQs
Type-safe HTTP client that doesn't suck - Fetch for humans who have stuff to build
The npm package @catalystlabs/typedfetch receives a total of 5 weekly downloads. As such, @catalystlabs/typedfetch popularity was classified as not popular.
We found that @catalystlabs/typedfetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.