https://github.com/ryanatkn/belt
utility belt for JS 🦕 ancient not extinct
https://github.com/ryanatkn/belt
js typescript web
Last synced: 23 days ago
JSON representation
utility belt for JS 🦕 ancient not extinct
- Host: GitHub
- URL: https://github.com/ryanatkn/belt
- Owner: ryanatkn
- License: mit
- Created: 2022-11-11T02:22:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-04T21:35:49.000Z (3 months ago)
- Last Synced: 2025-03-21T20:47:50.302Z (3 months ago)
- Topics: js, typescript, web
- Language: TypeScript
- Homepage: https://belt.ryanatkn.com/
- Size: 1.09 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @ryanatkn/belt
[
](https://belt.ryanatkn.com/)
> utility belt for JS 🦕 ancient not extinct
**[belt.ryanatkn.com](https://belt.ryanatkn.com)**
design:
- kitchen-sink utilities library - sorry, I wish it weren't so, JS made me do it
- one optional runtime dependency on `esm-env`, one optional type dependency on `@types/node`
- mix of JS module environments - browser-only, Node-only, universal
- mostly small pure functions
- all TypeScript, for styles and Svelte and SvelteKit
see @ryanatkn/fuz
- complements the modern web platform, drops legacy quickly
- kinda minimal in many ways but also not, treeshakes well## usage
Install from [npm](https://www.npmjs.com/package/@ryanatkn/belt):
```bash
npm i -D @ryanatkn/belt
```Import modules at their full paths:
```ts
import {type Result, unwrap} from '@ryanatkn/belt/result.js';
import {random_int} from '@ryanatkn/belt/random.js';
```Docs are a work in progress -
see the available modules at [belt.ryanatkn.com](https://belt.ryanatkn.com) and
[/src/routes/package.ts](https://github.com/ryanatkn/belt/blob/main/src/routes/package.ts),
I recommend reading the source code for now when the doc comments and types are insufficient.## build
```bash
npm run build
# or
gro build
```## test
For more see [`uvu`](https://github.com/lukeed/uvu)
and [Gro's test docs](https://github.com/feltjs/gro/blob/main/src/docs/test.md).```bash
gro test
gro test filepattern1 filepatternB
gro test -- uvu --forwarded_args 'to uvu'
```## deploy
[Deploy](https://github.com/feltjs/gro/blob/main/src/docs/deploy.md)
(build, commit, and push) to the `deploy` branch, e.g. for GitHub Pages:```bash
npm run deploy
# or
gro deploy
```## credits 🐢🐢🐢
My sister Lisa helped me with the logo -
[instagram.com/lisaeatkinson](https://www.instagram.com/lisaeatkinson/) -
she's a designer and currently looking for work## license [🐦](https://wikipedia.org/wiki/Free_and_open-source_software)
[MIT](LICENSE)