Socket
Socket
Sign inDemoInstall

itty-router

Package Overview
Dependencies
0
Maintainers
2
Versions
264
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

itty-router


Version published
Weekly downloads
41K
increased by19.59%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Itty Router

npm version bundle size build status code coverage weekly downloads open issues
join us on discord repo stars follow ittydev


An ultra-tiny API microrouter, for use when size matters (e.g. Cloudflare Workers).

Features

Example (Cloudflare Worker or Bun)

import { AutoRouter } from 'itty-router' // ~1kB

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

// that's it ^-^

Full Documentation @ itty.dev

Complete API documentation is available at itty.dev/itty-router, or join our Discord channel to chat with community members for quick help!

Join the Discussion!

Have a question? Suggestion? Idea? Complaint? Want to send a gift basket?

Join us on Discord!

Special Thanks: Contributors

These folks are the real heroes, making open source the powerhouse that it is! Help out and get your name added to this list! <3

Core Concepts
  • @mvasigh - proxy hack wizard behind itty, coding partner in crime, maker of the entire doc site, etc, etc.
  • @hunterloftis - router.handle() method now accepts extra arguments and passed them to route functions
  • @SupremeTechnopriest - improved TypeScript support and documentation! :D
Code Golfing
  • @taralx - router internal code-golfing refactor for performance and character savings
  • @DrLoopFall - v4.x re-minification
Fixes & Build
  • @taralx - QOL fixes for contributing (dev dep fix and test file consistency) <3
  • @technoyes - three kind-of-a-big-deal errors fixed. Imagine the look on my face... thanks man!! :)
  • @roojay520 - TS interface fixes
  • @jahands - v4.x TS fixes
  • and many, many others
Documentation

Keywords

FAQs

Last updated on 20 Mar 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc