UNPKG

3.13 kBMarkdownView Raw
1# Comet
2
3☄️ A powerful DX-first routing library for [Cloudflare Workers][cloudflare-workers-url].
4
5[![NPM Version][npm-version-image]][npm-url]
6[![NPM Install Size][npm-install-size-image]][npm-install-size-url]
7[![NPM Downloads][npm-downloads-image]][npm-downloads-url]
8
9```ts
10import { GET, server } from '@neoaren/comet'
11
12const comet = server()
13
14comet.route({ pathname: '/api/test/:id', method: GET }, async event => {
15 // Business logic
16 return event.reply.ok({ id: event.params.id })
17})
18
19export default <ExportedHandler>{
20 fetch: comet.handler
21}
22```
23
24## Work in progress (beta)
25This library is currently in **beta** and is being tested in various projects to ensure good usability and smooth functioning. A stable 1.0.0 version will be released in the near future, alongside some up-to-date documentation. Until then, please use it at your own discretion.
26
27## Documentation
28The up-to-date documentation will be provided alongside the 1.0.0 release.
29
30## Contribution guide
31Use commit names with the following prefixes to indicate their purpose
32
33| Emoji | Prefix | Description |
34|--------------------------|----------------------------|------------------------------------------------------------|
35| :zap: :zap: | `:zap: :zap:` | for implementing breaking functionality (semver major) |
36| :zap: | `:zap:` | for implementing non-breaking functionality (semver minor) |
37| :hammer: | `:hammer:` | for bug fixes and non-breaking improvements (semver patch) |
38| :wrench: | `:wrench:` | for configurations |
39| :vertical_traffic_light: | `:vertical_traffic_light:` | for tests |
40| :memo: | `:memo:` | for documentations |
41| :mag: | `:mag:` | for lint fixes |
42| :recycle: | `:recycle:` | for non-breaking refactoring |
43| :paperclip: | `:paperclip:` | for dependencies |
44| :octocat: | `:octocat:` | for workflows |
45| :construction: | `:construction:` | for experimental or temporary changes |
46
47[cloudflare-workers-url]: https://workers.cloudflare.com/
48[npm-downloads-image]: https://badgen.net/npm/dm/@neoaren/comet
49[npm-downloads-url]: https://npmcharts.com/compare/@neoaren/comet?minimal=true
50[npm-install-size-image]: https://badgen.net/packagephobia/install/@neoaren/comet
51[npm-install-size-url]: https://packagephobia.com/result?p=@neoaren/comet
52[npm-url]: https://npmjs.org/package/@neoaren/comet
53[npm-version-image]: https://badgen.net/npm/v/@neoaren/comet
54[documentation-url]: https://github.com/NeoAren/comet/wiki