UNPKG

3.05 kBMarkdownView Raw
1# Comet
2
3☄️ A convenient declarative 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 { comet, useRoute } from '@neoaren/comet'
11
12useRoute({ pathname: '/api', method: 'GET' }, event => {
13 return event.reply.ok({ message: 'Hello world!' })
14})
15
16export default { fetch: comet() }
17```
18
19## Work in progress
20This library is currently **in development**. The syntax in this documentation is subject to change, and some features still need further testing to eliminate potential issues. A stable 1.0.0 release is expected by the end of 2022, until then use it at your own discretion.
21
22## Documentation
23Read the documentation at our GitHub Wiki [here][documentation-url]!
24
25## Contribution guide
26Use commit names with the following prefixes to indicate their purpose
27
28| Emoji | Prefix | Description |
29|--------------------------|----------------------------|------------------------------------------------------------|
30| :zap: :zap: | `:zap: :zap:` | for implementing breaking functionality (semver major) |
31| :zap: | `:zap:` | for implementing non-breaking functionality (semver minor) |
32| :hammer: | `:hammer:` | for bug fixes and non-breaking improvements (semver patch) |
33| :wrench: | `:wrench:` | for configurations |
34| :vertical_traffic_light: | `:vertical_traffic_light:` | for tests |
35| :memo: | `:memo:` | for documentations |
36| :mag: | `:mag:` | for lint fixes |
37| :recycle: | `:recycle:` | for non-breaking refactoring |
38| :paperclip: | `:paperclip:` | for dependencies |
39| :octocat: | `:octocat:` | for workflows |
40| :construction: | `:construction:` | for experimental or temporary changes |
41
42[cloudflare-workers-url]: https://workers.cloudflare.com/
43[npm-downloads-image]: https://badgen.net/npm/dm/@neoaren/comet
44[npm-downloads-url]: https://npmcharts.com/compare/@neoaren/comet?minimal=true
45[npm-install-size-image]: https://badgen.net/packagephobia/install/@neoaren/comet
46[npm-install-size-url]: https://packagephobia.com/result?p=@neoaren/comet
47[npm-url]: https://npmjs.org/package/@neoaren/comet
48[npm-version-image]: https://badgen.net/npm/v/@neoaren/comet
49[documentation-url]: https://github.com/NeoAren/comet/wiki