0.8.1 • Published 2 years ago
@feltjs/util v0.8.1
@feltjs/util
JS utilities to complement the modern web platform 🦕🐋 util.felt.dev
design:
- kitchen-sink utilities library (sorry, we wish it weren't so, JS made us do it)
- mix of JS module environments - browser-only, Node-only, universal
- mostly small, pure functions
- near-zero non-platform third party dependencies,
currently the one exception is
kleur
- all TypeScript, no Svelte or SvelteKit
- complement the modern web platform, stay evergreen
- kinda minimal in many ways but also not
usage
// import anything from the root, except the modules that rely on Node-only dependencies -
// see $lib/index.ts for more
import {type Result, unwrap, randomInt} from '@feltjs/util';
// or import full module paths:
import {type Result, unwrap} from '@feltjs/util/result.js';
import {randomInt} from '@feltjs/util/random.js';
// these aren't exported from the root:
import {toPathStem} from '@feltjs/util/path.js';
import {spawn} from '@feltjs/util/process.js';
see the available modules at util.felt.dev, src/lib/index.ts, and src/lib/exports.ts
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 🐢🐢🐢
depends on kleur
made with Svelte ∙ SvelteKit ∙ Vite ∙ esbuild ∙ uvu ∙ TypeScript ∙ ESLint ∙ Prettier ∙ FeltUI ∙ Gro & more