Features: - Zero configuration, just works out of the box - Runtime type inference and validation - Built-in caching with W-TinyLFU algorithm - Automatic retries with exponential backoff - Circuit breaker for resilience - Request deduplication - Offline support with queue - OpenAPI schema discovery - Full TypeScript support with type descriptors - Modular architecture - Configurable for advanced use cases Built with bun, ready for npm publishing
27 lines
No EOL
777 B
TypeScript
27 lines
No EOL
777 B
TypeScript
#!/usr/bin/env bun
|
|
|
|
import { tf } from '../src/index.js'
|
|
|
|
console.log('🚀 Quick Revolutionary Test')
|
|
console.log('===========================')
|
|
|
|
async function quickTest() {
|
|
try {
|
|
console.log('Testing basic GET request...')
|
|
const result = await tf.get('https://httpbin.org/json')
|
|
console.log('✅ Basic GET works:', result.data ? 'Got data' : 'No data')
|
|
|
|
console.log('Testing type inference...')
|
|
const types = tf.getAllTypes()
|
|
console.log('✅ Type registry:', Object.keys(types).length, 'endpoints')
|
|
|
|
console.log('Testing metrics...')
|
|
const metrics = tf.getMetrics()
|
|
console.log('✅ Metrics:', metrics.totalRequests, 'requests tracked')
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error:', error.message)
|
|
}
|
|
}
|
|
|
|
quickTest() |