Getting Started
Learn how to install and use prelude-js in your project.
Install
Install the preludejs package. It has zero external runtime dependencies.
bun add preludejsnpm install preludejspnpm add preludejsyarn add preludejsImport and Use
Import the namespaces directly from preludejs or target individual modules/functions for maximum tree-shaking performance.
import { Func, List } from 'preludejs';
// Functions are curried by default
const add = Func.curry((a: number, b: number) => a + b);
const inc = add(1);
const result = List.map(inc, [1, 2, 3]); // => [2, 3, 4]Or import subpaths directly:
import curry from 'preludejs/Func/curry.js';
import map from 'preludejs/List/map.js';
const add = curry((a: number, b: number) => a + b);
const result = map(add(1), [1, 2, 3]); // => [2, 3, 4]