Skip to content

ryanatkn/belt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7ec5574 Β· Mar 4, 2025
Mar 4, 2025
Sep 15, 2024
Mar 4, 2025
Oct 5, 2024
Oct 31, 2024
Mar 4, 2025
Sep 20, 2023
Nov 5, 2024
Jul 5, 2024
Mar 4, 2025
Mar 4, 2025
Nov 4, 2024
Sep 29, 2024
Jul 3, 2024

Repository files navigation

@ryanatkn/belt

a green sauropod wearing a brown utility belt

utility belt for JS πŸ¦• ancient not extinct

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

npm i -D @ryanatkn/belt

// 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

license 🐦

MIT