npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

limbda

v0.3.2

Published

Functional programming helper library.

Readme

limbda

Build Status

Rationale

After having implemented array reduce with using ES6 features I remembered while having worked with Clojure for a while how nice it was that collection transformations could be done on any type of collection. One of the library's aims is to make transformations work for all collection types as well as implement some functional programming paradigms to make function composing easier.

This library is a playground for me at the same time. It's fun to experiment with basic datastructures and transformations. And also a good place to play with ES6 features also.

State

Creation of proper benchmarking is in progress.

Sample, sum 10 000 numbers:

limbda#reduce | Sum numbers 0.00011549035685890135

lodash#reduce | Sum numbers 0.00012098247137972124

Array#reduce | Sum numbers 0.00006934145322898773

Breaking changes might happen. Best thing to do if you'd like to sniff around is to check the tests to get a picture how the library methods work. (Tests keep the contract for the functions' interface, check them for change between commits before you upgrade to a new version.)

Install

npm install limbda

Usage

Import as you would any other packege in Node.js, eg.:

const limbda = require('limbda');

Documentation

isIterable

Check if x implements the iterable interface/protocol. (ES6 rest/spread operations, also generators need iterables.)

isIterable(x: Any?) -> Boolean

reduce, map, filter

Reduce, map & filter work for all basic Javascript collection types: String, Array, Object, Map, Set & Arguments (Array-likes).

Transforming functions

When reducing, mapping or filtering an String, Array or Set, item will be a value. In case of key-value types, item will be an "Object Entry", a.k.a. an Array of 2 items, a pair, [key, value]. See signatures.

The transforming functions should return a value so that collection transformation will have a "worthwhile" final value in the end.

reduce

reduce(reducer: Function, collection: AnyColl?, initialValue: Any?) -> Any?
reducerFunction(accumulator: Any?, item: Any?) -> Any?
# String, Array & Set reducer signature:
const reducerA = (accumulator, value) => accumulator + value;
# Object, Map reducer signature:
const reducerB = (accumulator, [key, value]) => accumulator + (key + value);

map

map(transformer: Function, collection: AnyColl?) -> Array
transformerFunction(value: Any?) -> Any?
# String, Array & Set transformer signature:
const transformerA = value => f(value);
# Object, Map transformer signature:
const transformerB = ([key, value]) => f(key, value);

filter

filter(filtering: Function, collection: AnyColl?) -> Array
filteringFunction(value: Any?) -> Bool?
# String, Array & Set filtering signature:
const filteringFnA = value => f(value);
# Object, Map filtering signature:
const filteringFnB = ([key, value]) => f(key, value);