0.2.0 ā€¢ Published 3 years ago

@sunder/kit v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

kit

CI NPM badge

Kit is a library of building blocks and utilities for Cloudflare Workers (CFW).

Functionality can be individually imported, so you can pick the parts you need without increasing your bundle size too much.

A few of the included modules are Sunder framework-specific, these are marked with ć€½ļø. All others modules should be easy to use in any CFW project.

What's included

šŸ‘Øā€šŸ’» Session management

  • šŸŖ A cookie-based authentication system for keeping users logged in securely. By being backed by Workers KV (or any other database) you can associate arbitrary data with a session, so there is little excuse for using JWT instead.

šŸ•µļøā€ā™€ļø Crypto & Encoding/Decoding

  • šŸ” Random token generation (cryptographically sound), use this to generate post IDs, user IDs or even secrets such as API tokens.
  • šŸ“¦ Base64 encoding and decoding (RFC 3548 compliant)
  • šŸ· Base-X encoding and decoding, which can be used for encoding data or random IDs with a given alphabet. Example alphabets:
    • Base 58 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz (does not contain Il0O for easier human copying)
    • Base 62 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ (base64 without special characters)
    • Base 36 0123456789abcdefghijklmnopqrstuvwxyz (all lowercase, useful for case-insensitive systems)

      Warning: these encodings are not RFC3548 compliant. The padding is different, base-x uses Bitcoin's padding scheme.

šŸ”Œ Plug-and-play middlewares

  • šŸ—‚ Static file serving (Cloudflare Sites) ć€½ļø
  • šŸ› Error logging through Sentry. ć€½ļø

Installation

npm i @sunder/kit

Documentation

šŸ‘·ā€ā™€ļø Guides and long-form docs are to-do, use the Typescript typings as your guide for now.

The docs will live on sunderjs.com.

License

MIT

0.2.0

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago