@ryanatkn/belt
v0.28.0
Published
utility belt for JS
Downloads
2,347
Readme
@ryanatkn/belt
utility belt for JS 🦕 ancient not extinct
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
// import full module paths:
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 and /src/routes/package.ts, I recommend reading the source code for now or asking an AI
build
npm run build
# or
gro build
test
For more see uvu
and Gro's test docs.
gro test
gro test filepattern1 filepatternB
gro test -- uvu --forwarded_args 'to uvu'
deploy
Deploy
(build, commit, and push) to the deploy
branch, e.g. for GitHub Pages:
npm run deploy
# or
gro deploy
credits 🐢🐢🐢
My sister Lisa helped me with the logo - instagram.com/lisaeatkinson - she's a designer and currently looking for work