WizJS

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
Library · Node · Browser · Edge

One library, organised by what you're trying to do.

Helpers live under namespaces — lang, io, math — so the right tool is wherever your fingers expect it.

Pull in everything

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

Cherry-pick what you need

Tree-shakable destructuring keeps bundles small.

const { lang: { checks: { isNil, isEmpty } } } =
  require('@wizhut_tech/wizjs')

if (isNil(value) || isEmpty(value)) {
  return defaultValue
}

Lazy iteration

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

Functional composition

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.

io.files

File system helpers — read, write, scan, and manipulate files without re-implementing fs boilerplate every time.

lang.arrays

Practical array operations beyond what the standard prototype gives you. Chunking, partitioning, deduping, set operations.

lang.checks

Type-safe predicates: isNil, isEmpty, isPlainObject, isString and friends. Drop-in replacements for the lodash predicates you actually use.

lang.flow

Control-flow helpers — retries, timeouts, debouncing, gating. The kind of utilities every codebase reinvents poorly.

lang.singleton

Singleton patterns done right — lazy initialisation, memoisation by key, single-flight semantics.

lang.functools

Functional programming primitives — compose, curry, partial application, pipe. Small, fast, and tree-shakable.

lang.itertools

Lazy iteration helpers inspired by Python's itertools — chain, zip, take, group, window. Works on any iterable.

math.numbers

Numeric utilities — clamping, ranges, rounding, statistics. Things you keep typing by hand.

Ready to drop in

Free, open source, and built to span Node, browsers, and edge runtimes. No magic, no surprises.