Skip to content

itty.devmighty [tiny] libraries

We count our bytes to keep your code small.

itty.dev

We really mean it. For example...

An edge-ready API in ~1 kB:

ts
import { AutoRouter } from 'itty-router' // ~970 bytes

export const router = AutoRouter()

router
  .get('/hello/:name', ({ name = 'World' }) => `Hello ${name}!`)
  .get('/json', () => [1,2,3])
  .get('/promises', () => Promise.resolve('foo'))

export default router

Clean API calls in ~650 bytes:

info
ts
import { fetcher } from 'itty-fetcher' // ~650 bytes

// Make simple calls...
fetcher().get('https://ittysockets.io/stats').then(console.log) // the actual parsed data

// or create a reusable API client
const api = fetcher('https://api.example.com', {
  headers: { 'Authorization': 'Bearer token' }
})

// and use it later
const users = await api.get('/users')
const newUser = await api.post('/users', { name: 'Alice' })