prelude.ls is a functionally oriented utility library designed to simplify common programming tasks by providing a rich set of curried functions. It is primarily written in LiveScript and serves as the recommended base library for LiveScript projects, although it is fully usable within standard JavaScript environments. The library offers a wide array of utilities for lists, objects, strings, functions, and numbers, emphasizing a functional programming paradigm with functions like `map`, `filter`, and `fold` readily available. The current stable version is 1.2.1. Given its last update approximately six years ago (around April 2020), its release cadence is effectively inactive, indicating it is no longer actively maintained. A key differentiator is its deep integration with and recommendation for the LiveScript ecosystem, providing a Haskell-like prelude module, and its consistent use of currying across most functions. It predates widespread modern JavaScript module systems and exclusively functions via CommonJS modules.
npm install prelude-lsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import `prelude-ls` using CommonJS and utilize its core functional programming utilities, including curried `map`, `filter`, `fold`, and an object-specific `Obj.map` function.
Consider migrating to a modern, actively maintained functional utility library such as Ramda, Lodash/fp, or a native JavaScript functional approach for new projects. For existing projects, be aware of potential long-term compatibility risks.
Always use `const P = require('prelude-ls');` for importing the library in Node.js and other CommonJS environments.Install the external type definitions using `npm install --save-dev @types/prelude-ls`. Be prepared to create or augment declaration files (`.d.ts`) for functions not fully covered or if types are outdated.
Ensure you provide all expected arguments to a curried function or explicitly handle the partially applied function. Refer to the prelude.ls documentation on currying for detailed usage examples.
When working with objects, explicitly use `P.Obj.map` to ensure you are applying the function intended for objects, and similarly for other specific data structure modules.
For Node.js, ensure your project is configured for CommonJS modules. For browser usage, use a bundler that can resolve CommonJS modules, or include the `prelude-browser.js` file directly from the package's `browser` directory via a `<script>` tag.
First, ensure the package is installed: `npm install prelude-ls`. If in Node.js, verify you are using `require('prelude-ls')`. If using a bundler, check its configuration for module resolution.Install the unofficial type definitions: `npm install --save-dev @types/prelude-ls`. If the issue persists for specific functions, you may need to manually augment the type declarations in a local `.d.ts` file.
No dependency data recorded yet.