@fuzdev/fuz_util
utility belt for JS 🦕 ancient not extinct
design:
- kitchen-sink utilities library - sorry, I wish it weren't so, JS made me do it
- dependencies are optional (
svelte,@fuzdev/blake3-wasm,@types/node,@types/estree) except two required peers:esm-envand@fuzdev/fuz_schema, which has no dependencies of its own; its schemas backPackageJson,Url,fetch.ts,args.ts, andbenchmark_baseline.ts, and brandFactHash - mix of JS module environments - browser-only and universal
- mostly small pure functions
- all TypeScript, for styles and Svelte and SvelteKit see @fuzdev/fuz_ui
- complements the modern web platform, drops legacy quickly
- kinda minimal in many ways but also not, treeshakes well
- includes a benchmarking library with rich statistical analysis
This library has no AI features by design, for that see zzz.
Usage
Install from npm:
npm i -D @fuzdev/fuz_util
Import modules at their full paths:
import {type Result, unwrap} from '@fuzdev/fuz_util/result.ts';
import {random_int} from '@fuzdev/fuz_util/random.ts';
.ts imports also work:
import {deep_equal} from '@fuzdev/fuz_util/deep_equal.ts';
Docs at util.fuz.dev/docs.
Features
Benchmarking
See docs/benchmark.md.
Build
npm run build
# or
gro build
Test
For more see Vitest and Gro's test docs.
gro test
gro test filepattern1 filepatternB
gro test -- --forwarded-args 'to vitest'
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