Absurdum is a Javascript utility library built with a focus on providing idempotent side-effect free functions and clear/readable modular source for tree shaking.
Features
- Explores the flexibility of Reduce
- Abstraction Free -> tree-shake friendly
- Functional -> all operators are side-effect free
- Polyfills -> includes operator polyfills for older browsers
- Modern -> works transparently with ESM and CJS
- Typescript -> typings are provided for all operators
- Intellisense -> supports code completions + inline documentation
- Well Tested -> includes 600+ tests covering every aspect
Imports
This package provides a variety of entry-points for all JS platforms
Browsers
All top-level operator namespaces (ie [arrays, objects, strings]
) can be imported from the index
;
The minified version can be imported from
;
Node/Bundlers (ESM)
Top-level ES module namespaces are provided for Node/Bundlers
;
Individual operators can be imported from their parent namespaces
;;;
Note: Webpack's tree-shaking algorithm doesn't handle multi-layered exports. To optimize bundle size, prefer individual operator imports.
Node/Legacy (CJS)
For Node users who rely on CommonJS, top-level namespaces are provided
const arrays = arrays;const objects = objects;const strings = strings;
Note: CJS entry-points are backward-compatible with all non-EOL versions of Node
Usage
Import an operator and feed it some inputs
; const input = 'a' 'b' 'c' 'd';const output = ;console;// > ['d', 'c', 'b', 'a']
Tip: For VSCode users. Input type-checking, intellisense, and inline documentation are all supported.