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

tolb

v0.13.1

Published

My personal set of javascript utility functions

Downloads

56

Readme

About the library

This library contains a set of javascript helper functions designed to allow a more functional style of code.
Each function takes the data upon which to operate as the last argument, and almost all functions can be partially applied with any number of arguments and in any number of operations.
The function reduce of the list package, for example, takes 3 arguments and can be used:

  • Passing all 3 arguments:

    const result = reduce(sum, 0, arrayOfNumbers);
  • Omiting the last argument (the data):

    const waitingData = reduce(sum, 0);
    const result = waitingData(arrayOfNumbers);
  • Omiting the last two arguments:

    const waitingLastTwoArgs = reduce(sum);
    const result = waitingLastTwoArgs(0, arrayOfNumbers);
    // or
    const nowWaitingData = waitingLastTwoArgs(0);
    const result = nowWaitingData(arrayOfNumbers);

Quick notes:

  • This library is meant to be light and simple. For more robust (and heavier) alternatives, check out lodash/fp and ramda.
  • I say that almost all functions can be partially applied because some functions in the lib are used to create functions, and those created functions can't be partially applied by default.

Installation

The only way to get this library is through npm.
Use a module bundler like webpack to use it on the browser.

npm install [--save] tolb

Usage

This library is distributed as a set of packages, so require the desired package, rather than the module itself:

const object = require('tolb/object');

object.values({ one: 1, two: 2 }); //=> [1, 2]

It's also possible to pull out only a specific function:

const map = require('tolb/list/map');
const { toUpper } = require('tolb/string');

map(toUpper, ['foo', 'bar']); //=> ['FOO', 'BAR']

Documentation

Each package is represented by a directory inside the src folder, and each function in that package is in its own file. Inside each file you will find a JSDoc comment explaining what the function does. Also, alongside with the source files, you will find test files that may help you to understand each function by showing you some usage examples.
That's the only documentation I have. By now...

A quick note.
Some packages are designed to work with a specific datatype. The functions in the math package, for example, expect numbers, and the functions in the string package expect, well, strings.
If the wrong type of argument is passed, an error may be thrown by the javascript runtime.or the function may fail silently. Make sure to pass the right argument to each function.

The "next" bundle

This module includes a next bundle. The only difference from next to the normal bundle is that it uses es6 module syntax, instead of commonJS.

If you're using a module bundler that takes advantage of the static nature of es6 modules (rollup.js does it, the v2 of webpack does it too), you might want to use this one.

Please, note some differences in the way packages are imported when using the next bundle.
I'm assuming that, because you're using next, you're also using the es6 syntax to do your imports.

This:

const object = require('tolb/object');
const { map } = require('tolb/list');
const compose = require('tolb/combinator/compose');

becomes this:

import * as object from 'tolb/next/object';
import { map } from 'tolb/next/list';
import compose from 'tolb/next/combinator/compose';

Replace tolb/next with tolb in imports

If you're using webpack, you can add the following to your configuration file:

    // ...
    resolve: {
      alias: {
        tolb: 'tolb/next',
      },
    },
    // ...

and then import from tolb

// `keys` will be imported from `tolb/next/object` 
import { keys } from 'tolb/object';