ubelt
raw JSON → 3.2.2 verified Sat Apr 25 auth: no javascript maintenance
A small utility belt library by Dominic Tarr providing common functional helpers (e.g., map, filter, reduce, pipe, compose) for Node.js and browsers. Current stable version 3.2.2, released infrequently as a maintenance package. Designed for small projects where lightweight dependencies are preferred. Key differentiator vs. Lodash/Ramda: minimal API surface, no dependencies, zero-config.
Common errors
error Cannot find module 'ubelt' ↓
cause Package not installed or incorrect version.
fix
Run 'npm install ubelt' to install the latest version.
error TypeError: ubelt.map is not a function ↓
cause Importing default export but trying to use named property incorrectly.
fix
Use named import: import { map } from 'ubelt'; or use default: const ubelt = require('ubelt'); then ubelt.map().
Warnings
breaking In v2, the package was renamed from 'dominictarr-ubelt' to 'ubelt'. Requires updating imports. ↓
fix Update package.json dependency to 'ubelt' and change import paths.
deprecated Some functions like 'toAsync' have been removed as they were experimental. ↓
fix Replace with native Promise or async/await patterns.
gotcha The 'map' function does not support object iteration; only arrays. ↓
fix Use Object.keys/values/entries or a library like Lodash for objects.
Install
npm install ubelt yarn add ubelt pnpm add ubelt Imports
- map wrong
import map from 'ubelt'correctimport { map } from 'ubelt' - pipe wrong
import { pipe } from 'ubelt'correctconst { pipe } = require('ubelt') - ubelt wrong
const ubelt = require('ubelt')correctimport ubelt from 'ubelt'
Quickstart
import { map, filter, pipe } from 'ubelt';
const result = pipe(
[1, 2, 3, 4],
filter(x => x % 2 === 0),
map(x => x * 2)
);
console.log(result); // [4, 8]