
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
A lightweight, and docile, JavaScript library to help embracing functional programming.
A lightweight, and docile, JavaScript (ES5) library to help embracing functional programming.
The API documentation is here.
Install it with npm
:
npm install lamb
Require it in node.js:
const _ = require("lamb");
Since version 0.57.0, Lamb is splitted in ES modules and can take advantage of tree-shaking capabilities of module bundlers:
import * as _ from "lamb";
You can also import only the functions you want to use:
import { compose, map } from "lamb";
In a browser, simply include the version you want from the dist
folder:
<script src="dist/lamb.js"></script>
or
<script src="dist/lamb.min.js"></script>
Doing so a lamb
variable will be created in the global object.
The source map for the minified file is in the same dist
folder.
Since version 0.58.0 there is also a one file ES modules build, always in the dist
folder, named lamb.mjs
(previously lamb.esm.js
) and its minified version lamb.min.mjs
(previously lamb.esm.min.js
).
Lamb it's also delivered on a CDN, courtesy of cdnjs, jsDelivr and unpkg:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lamb/0.61.1/lamb.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lamb@0.61.1/dist/lamb.min.js"></script>
<script src="https://unpkg.com/lamb@0.61.1/dist/lamb.min.js"></script>
Please note that Lamb is served by jsDelivr since version 0.42.0.
You can try it right now in your browser, too.
Lamb uses semantic versioning and please be aware that, as long as the major version is 0
, any
bump in the minor version could involve a breaking change in the API.
You can check the recent or the full changelog to see if your code is affected.
Is another JavaScript library really needed? Don't know, really. The story here is that I like to write my own code and, time permitting, to even reinvent the wheel: it's part of my learning process. This library is only a means for me to gather some utilities I wrote, clean them up a bit and put them together with some new tools to make a documented, reusable package.
Are your wheels rounder? Not at all, but I do try my best to add better suspension; and you do realise that you're reading a guy talking to himself, don't you?
Why you say "to help embracing functional programming"? Is it for beginners? No, it's a utility library for everyone; beginners included, though. Lamb embraces functional concepts and encourages users to take advantage of them, but without forcing anyone to change his style. Experienced functional programmers will feel immediately at home, and beginners will discover that the library is able to adapt to them while their knowledge grows.
Why ECMAScript 5? Because this is simply me tidying up some old code, and will hopefully be my goodbye to ES5 before fully diving into the world of transpilers.
What about ES4 environments? In my make-believe world they don't exist, but in case I can be proven wrong you can load some shims / polyfills before my library. There's plenty of those in the JavaScript Reference on MDN, and there are many pre-made packages as well out there.
Are there plans for the future? Absolutely yes: this isn't a complete work at all, only a first public release. I need better documentation and examples for starters, and I also want to add a bunch of other functions and concepts into the mix.
I really like Lamb's logo: are you the designer? I like it a lot too and, no, it isn't my doing: the author is a very talented designer who never signs his works by choice and doesn't want to be credited for it. Other than being eternally grateful, the least I can do is offer my services as a middleman and put you in touch if you need his craft.
Why "Lamb"? See the main header: because it's docile like a lamb. Lamb adapts to you without needing you to adapt.
You can also check the full changelog.
v0.61.1 - 2023/11/15
reduceWith
and reduceRightWith
not using the initial value when reduce
was called with more than three argumentsv0.61.0 - 2022/11/09
symmetricDifference
difference
, intersection
, symmetricDifference
, union
, unionBy
, uniques
and uniquesBy
v0.60.0 - 2021/03/08
mean
, median
and replace
v0.59.2 - 2020/07/17
package.json
to address the issue where some tools couldn't access the manifest file. See https://github.com/nodejs/node/issues/33460.v0.59.0 - 2020/07/07
lamb.mjs
)split
and splitBy
pick
to pickIn
and pickKeys
to pick
skip
to skipIn
and skipKeys
to skip
rename
to renameIn
and renameKeys
to rename
pluck
to pluckFrom
and pluckKey
to pluck
case
to casus
to avoid confusion and clashing with the switch statement's caseinvoker
and invokerOn
to invoke
and invokeOn
.DS_STORE
file leaking again in the dist
folderFAQs
A lightweight, and docile, JavaScript library to help embracing functional programming.
The npm package lamb receives a total of 133 weekly downloads. As such, lamb popularity was classified as not popular.
We found that lamb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.