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
34 lines
No EOL
1.2 KiB
TypeScript
34 lines
No EOL
1.2 KiB
TypeScript
#!/usr/bin/env bun
|
|
|
|
console.log('🔍 Debug Test - Checking Revolutionary Features')
|
|
console.log('===============================================')
|
|
|
|
try {
|
|
console.log('1. Importing revolutionary module...')
|
|
const module = await import('../src/index.js')
|
|
console.log('✅ Import successful')
|
|
|
|
console.log('2. Checking exports...')
|
|
console.log(' - tf:', typeof module.tf)
|
|
console.log(' - createTypedFetch:', typeof module.createTypedFetch)
|
|
console.log(' - WTinyLFUCache:', typeof module.WTinyLFUCache)
|
|
|
|
console.log('3. Testing tf instance...')
|
|
const { tf } = module
|
|
console.log(' - tf.get:', typeof tf.get)
|
|
console.log(' - tf.getMetrics:', typeof tf.getMetrics)
|
|
console.log(' - tf.getAllTypes:', typeof tf.getAllTypes)
|
|
|
|
console.log('4. Making simple request...')
|
|
const response = await fetch('https://httpbin.org/json')
|
|
const data = await response.json()
|
|
console.log('✅ Direct fetch works:', data ? 'Got data' : 'No data')
|
|
|
|
console.log('5. Testing tf.get...')
|
|
const result = await tf.get('https://httpbin.org/json')
|
|
console.log('✅ tf.get works:', result.data ? 'Got data' : 'No data')
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error:', error.message)
|
|
console.error('Stack:', error.stack)
|
|
} |