itty-router 2.4.1 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/package.json +19 -12
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ![Itty Router][logo-image]
|
|
1
|
+
# [![Itty Router][logo-image]][itty-homepage]
|
|
2
2
|
|
|
3
3
|
[![npm package][npm-image]][npm-url]
|
|
4
4
|
[![minified + gzipped size][gzip-image]][gzip-url]
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<a href="https://npmjs.com/package/itty-router" target="\_parent">
|
|
9
9
|
<img alt="" src="https://img.shields.io/npm/dm/itty-router.svg" />
|
|
10
10
|
</a>
|
|
11
|
+
[![Discord][discord-image]][discord-url]
|
|
11
12
|
<a href="https://github.com/kwhitley/itty-router" target="\_parent">
|
|
12
13
|
<img alt="" src="https://img.shields.io/github/stars/kwhitley/itty-router.svg?style=social&label=Star" />
|
|
13
14
|
</a>
|
|
@@ -18,9 +19,11 @@
|
|
|
18
19
|
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
|
|
19
20
|
</a>-->
|
|
20
21
|
|
|
21
|
-
It's an itty bitty router, designed for
|
|
22
|
+
It's an itty bitty router, designed for express-like routing within [Cloudflare Workers](https://developers.cloudflare.com/workers/) (or anywhere else). Like... it's super tiny ([~4xx bytes](https://bundlephobia.com/package/itty-router)), with zero dependencies. For reals.
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
### Addons & Related Libraries
|
|
25
|
+
1. [itty-router-extras](https://www.npmjs.com/package/itty-router-extras) - adds quality-of-life improvements and utility functions for simplifying request/response code (e.g. middleware, cookies, body parsing, json handling, errors, and an itty version with automatic exception handling)!
|
|
26
|
+
2. [itty-durable](https://github.com/kwhitley/itty-durable) - creates a more direct object-like API for interacting with [Cloudflare Durable Objects](https://developers.cloudflare.com/workers/learning/using-durable-objects).
|
|
24
27
|
|
|
25
28
|
## Features
|
|
26
29
|
- [x] Tiny ([~4xx bytes](https://bundlephobia.com/package/itty-router) compressed) with zero dependencies.
|
|
@@ -32,9 +35,10 @@ For quality-of-life improvements (e.g. middleware, cookies, body parsing, json h
|
|
|
32
35
|
- [x] [Base path](#nested-routers-with-404-handling) for prefixing all routes.
|
|
33
36
|
- [x] [Multi-method support](#nested-routers-with-404-handling) using the `.all()` channel.
|
|
34
37
|
- [x] Supports **any** method type (e.g. `.get() --> 'GET'` or `.puppy() --> 'PUPPY'`).
|
|
38
|
+
- [x] Supports [Cloudflare ES Module syntax](#cf-es6-module-syntax)! :)
|
|
39
|
+
- [x] [Preload or manually inject custom regex for routes](#manual-routes) (advanced usage)
|
|
35
40
|
- [x] [Extendable](#extending-itty-router). Use itty as the internal base for more feature-rich/elaborate routers.
|
|
36
41
|
- [x] Chainable route declarations (why not?)
|
|
37
|
-
- [x] [Preload or manually inject custom regex for routes](#manual-routes) (advanced usage)
|
|
38
42
|
- [ ] Readable internal code (yeah right...)
|
|
39
43
|
|
|
40
44
|
## Installation
|
|
@@ -437,6 +441,9 @@ This trick allows methods (e.g. "get", "post") to by defined dynamically by the
|
|
|
437
441
|
[david-url]:https://david-dm.org/kwhitley/itty-router
|
|
438
442
|
[coveralls-image]:https://coveralls.io/repos/github/kwhitley/itty-router/badge.svg?branch=v1.x
|
|
439
443
|
[coveralls-url]:https://coveralls.io/github/kwhitley/itty-router?branch=v1.x
|
|
444
|
+
[itty-homepage]:https://itty-router.dev
|
|
445
|
+
[discord-image]:https://img.shields.io/discord/832353585802903572
|
|
446
|
+
[discord-url]:https://discord.com/channels/832353585802903572
|
|
440
447
|
|
|
441
448
|
## Contributors
|
|
442
449
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "itty-router",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"description": "Tiny, zero-dependency router with route param and query parsing - build for Cloudflare Workers, but works everywhere!",
|
|
5
5
|
"main": "./dist/itty-router.min.js",
|
|
6
6
|
"types": "./dist/itty-router.d.ts",
|
|
@@ -11,14 +11,21 @@
|
|
|
11
11
|
"keywords": [
|
|
12
12
|
"router",
|
|
13
13
|
"cloudflare",
|
|
14
|
+
"worker",
|
|
14
15
|
"workers",
|
|
15
16
|
"serverless",
|
|
17
|
+
"api",
|
|
16
18
|
"express",
|
|
17
19
|
"regex",
|
|
18
20
|
"routing",
|
|
19
|
-
"api",
|
|
20
21
|
"handler",
|
|
21
22
|
"params",
|
|
23
|
+
"request",
|
|
24
|
+
"response",
|
|
25
|
+
"service worker",
|
|
26
|
+
"sw",
|
|
27
|
+
"cf",
|
|
28
|
+
"optional",
|
|
22
29
|
"middleware",
|
|
23
30
|
"nested",
|
|
24
31
|
"rest",
|
|
@@ -55,20 +62,20 @@
|
|
|
55
62
|
},
|
|
56
63
|
"homepage": "https://itty-router.dev",
|
|
57
64
|
"devDependencies": {
|
|
58
|
-
"@vitejs/plugin-vue": "^1.
|
|
59
|
-
"@vue/compiler-sfc": "^3.
|
|
60
|
-
"chalk": "^4.1.
|
|
61
|
-
"coveralls": "^3.1.
|
|
62
|
-
"eslint": "^7.
|
|
63
|
-
"eslint-plugin-jest": "^24.
|
|
65
|
+
"@vitejs/plugin-vue": "^1.4.0",
|
|
66
|
+
"@vue/compiler-sfc": "^3.2.2",
|
|
67
|
+
"chalk": "^4.1.2",
|
|
68
|
+
"coveralls": "^3.1.1",
|
|
69
|
+
"eslint": "^7.32.0",
|
|
70
|
+
"eslint-plugin-jest": "^24.4.0",
|
|
64
71
|
"fs-extra": "^10.0.0",
|
|
65
72
|
"gzip-size": "^6.0.0",
|
|
66
73
|
"isomorphic-fetch": "^3.0.0",
|
|
67
|
-
"jest": "^27.0.
|
|
74
|
+
"jest": "^27.0.6",
|
|
68
75
|
"rimraf": "^3.0.2",
|
|
69
|
-
"uglify-js": "^3.
|
|
70
|
-
"vite": "^2.
|
|
71
|
-
"yarn": "^1.22.
|
|
76
|
+
"uglify-js": "^3.14.1",
|
|
77
|
+
"vite": "^2.4.4",
|
|
78
|
+
"yarn": "^1.22.11",
|
|
72
79
|
"yarn-release": "^1.10.3"
|
|
73
80
|
}
|
|
74
81
|
}
|