Curated JavaScript utilities — without the lodash bloat
A practical, opinionated toolbox of helpers we actually reach for in production — type checks, control-flow, functional primitives, lazy iteration, math. Carefully chosen dependencies, designed to work across Node, the browser, and edge runtimes.
npm install @wizhut_tech/wizjs Helpers live under namespaces — lang, io, math — so the right tool is wherever your fingers expect it.
Useful at the REPL or in scripts where bundle size doesn't matter.
const wizjs = require('@wizhut_tech/wizjs') wizjs.lang.checks.isNil(undefined) // → true wizjs.lang.checks.isPlainObject({ a: 1 }) // → true wizjs.math.numbers.clamp(42, 0, 10) // → 10
Tree-shakable destructuring keeps bundles small.
const { lang: { checks: { isNil, isEmpty } } } = require('@wizhut_tech/wizjs') if (isNil(value) || isEmpty(value)) { return defaultValue }
itertools mirrors the Python primitives we all miss.
const { lang: { itertools } } = require('@wizhut_tech/wizjs') const pairs = itertools.zip(['a', 'b', 'c'], [1, 2, 3]) // → [['a', 1], ['b', 2], ['c', 3]]const windowed = itertools.window([1, 2, 3, 4, 5], 3) // → [[1,2,3], [2,3,4], [3,4,5]]
functools for compose, pipe, curry, partial.
const { lang: { functools: { pipe } } } = require('@wizhut_tech/wizjs') const slugify = pipe( s => s.toLowerCase(), s => s.trim(), s => s.replace(/\s+/g, '-') ) slugify(' Hello World ') // → 'hello-world'
Eight focused namespaces
Practical helpers, drawn from real production codebases — and only the ones that actually carry their weight.
File system helpers — read, write, scan, and manipulate files without re-implementing fs boilerplate every time.
Practical array operations beyond what the standard prototype gives you. Chunking, partitioning, deduping, set operations.
Type-safe predicates: isNil, isEmpty, isPlainObject, isString and friends. Drop-in replacements for the lodash predicates you actually use.
Control-flow helpers — retries, timeouts, debouncing, gating. The kind of utilities every codebase reinvents poorly.
Singleton patterns done right — lazy initialisation, memoisation by key, single-flight semantics.
Functional programming primitives — compose, curry, partial application, pipe. Small, fast, and tree-shakable.
Lazy iteration helpers inspired by Python's itertools — chain, zip, take, group, window. Works on any iterable.
Numeric utilities — clamping, ranges, rounding, statistics. Things you keep typing by hand.
Open source
Free, open source, and built to span Node, browsers, and edge runtimes. No magic, no surprises.