Skip to content

fuzdev/fuz_util

Repository files navigation

@fuzdev/fuz_util

a green sauropod wearing a brown utility belt

utility belt for JS 🦕 ancient not extinct

util.fuz.dev

design:

  • kitchen-sink utilities library - sorry, I wish it weren't so, JS made me do it
  • two optional runtime dependencies on zod and 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 @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

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.js';
import {random_int} from '@fuzdev/fuz_util/random.js';

.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

license 🐦

MIT

About

utility belt for JS 🦕 ancient not extinct

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Languages