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

@zambit/elevate-ts

v0.6.0

Published

Functional programming library for TypeScript. Available under AGPL-3.0 or Commercial License.

Readme

elevate-ts

Coverage npm License: AGPL%20v3%2B

Point-free, data-last functional programming for TypeScript. Fantasy Land 5 compliant. Zero dependencies. Cloudflare Workers ready.

Install

pnpm add @zambit/elevate-ts

Philosophy

  • Point-free: Functions are composed by shape, not by naming intermediate values
  • Data-last: Configuration arguments precede the data being transformed
  • Pure: No classes, no mutations, ≤15 lines per function
  • Cloudflare Workers: No Node.js built-ins, no DOM APIs
  • Fantasy Land 5: All applicable types implement the spec
  • Zero runtime dependencies: Ship only pure TypeScript

Quick Start

import { pipe } from '@zambit/elevate-ts/Function';
import { Just, Nothing, map, chain } from '@zambit/elevate-ts/Maybe';

// When condition is met
const result1 = pipe(
  Just(5),
  map((a) => a * 2), // Just(10)
  chain((b) => (b > 5 ? Just(b) : Nothing)) // Just(10)
);

// When condition fails
const result2 = pipe(
  Just(2),
  map((a) => a * 2), // Just(4)
  chain((b) => (b > 5 ? Just(b) : Nothing)) // Nothing
);

Modules

| Module | Description | | ----------------- | -------------------------------------------------------------------------------- | | Maybe | Optional values; Functor, Applicative, Monad, Alt, Filter | | Either | Values with a Left error branch; Bifunctor, Monad, Alt | | Validation | Functor for collecting all errors during applicative (not short-circuit) | | Reader | Dependency injection / environment access; Functor, Applicative, Monad | | State | Pure stateful computation; Functor, Applicative, Monad | | Tuple | Immutable 2-tuple; Functor, Bifunctor | | NonEmptyList | Guaranteed-nonempty array; Functor, Applicative, Monad, Monoid | | List | Utilities over plain readonly arrays; map, filter, partition, zip, etc. | | Function | Function composition and utilities; pipe, flow, curry, memoize, once, tap | | MaybeAsync | Lazy async Maybe; rejects or throws become Nothing; never rejects | | EitherAsync | Lazy async Either; rejects become Left; never throws | | ReaderEitherAsync | Lazy async Either with dependency injection; (env: R) => Promise<Either<L, A>> | | Audit | Operation tracking with time-travel replay; configurable ID generation | | HTTP | CloudFlare Workers & Web Fetch API helpers; safe JSON, env, error mapping |

Quick API Reference

Browse the complete API reference → for all functions and types.

Maybe

Just(value) | Nothing
map(f) | chain(f) | getOrElse(default)
fromNullable(a) | filter(predicate) | fold(onNothing, onJust)

Either

Left(error) | Right(value)
map(f) | mapLeft(f) | bimap(f, g) | chain(f)
getOrElse(default) | fold(onLeft, onRight)
fromPredicate(p, onFalse) | tryCatch(f, onError)

Validation

Failure(errors) | Success(value);
ap(vf) | chain(f) | fold(onFailure, onSuccess);
fromEither(ea) | sequence(validations);

Reader

Reader(run) | ask() | asks(f) | local(f);
map(f) | chain(f) | runReader(env);

State

State(run) | get() | put(s) | modify(f) | gets(f);
map(f) | chain(f);
runState(s) | evalState(s) | execState(s);

Tuple

Tuple(fst, snd);
fst | snd | mapFst(f) | mapSnd(f) | bimap(f, g) | swap();
fanout(f, g);

NonEmptyList

fromArray(arr) | fromArrayUnsafe(arr);
head(nel) | tail(nel) | last(nel) | init(nel);
map(f) | chain(f) | concat(nel2);

List

head(arr) | tail(arr) | take(n) | drop(n);
partition(p) | groupBy(eq) | sortBy(ord);
zip(arr2) | zipWith(f) | flatten();

Function

identity | constant(a) | flip(f)
pipe(a, f1, f2, ...) | flow(f1, f2, ...)
curry2(f) | curry3(f) | curry4(f)
memoize(f) | once(f) | tap(f)

MaybeAsync

MaybeAsync(run) | liftMaybe(ma)
of(value) | nothing()
map(f) | chain(f) | getOrElse(default)
fromPromise(p) | tryCatch(f)
fold(onNothing, onJust) | toEitherAsync(onNothing)

EitherAsync

EitherAsync(run) | liftEither(ea)
of(value) | right(value) | left(error)
map(f) | mapLeft(f) | chain(f)
getOrElse(default) | fold(onLeft, onRight)
fromPromise(p, onError) | tryCatch(f, onError)
toMaybeAsync(ea)

ReaderEitherAsync

ReaderEitherAsync(run) | of(value) | right(value) | left(error)
liftEither(ea) | liftEitherAsync(ea) | liftReader(r)
ask() | asks(f) | asksEither(f) | asksEitherAsync(f) | local(f) | provide(env)
map(f) | mapLeft(f) | bimap(f, g) | chain(f) | chainLeft(f) | ap(rf)
fromPromise(p, onError) | tryCatch(f, onError)
runReaderEitherAsync(env) | getOrElse(default) | fold(onLeft, onRight)
all(reas)

Audit

createSession(opts) | withEnabled(bool) | withCaptureInputs(bool);
track(op, fn) | record(op, result) | getLog() | replay(index);
filterByOperation(op) | filterByMonadType(monad) | entryAt(index);

See docs/AUDIT.md for comprehensive guide with worked examples (simple, medium, complex scenarios).

HTTP

jsonResponse(status) | parseJSON(raw) | askEnv(key) | requireEnv(key);
withStatusCode(codes) | handleEither(onL, onR) | handleEitherAsync(onL, onR);

See docs/HTTP.md for comprehensive guide with CloudFlare Workers examples (simple, medium, complex scenarios).

Learning & Examples

  • elevate-ts-learning - Comprehensive tutorial with interactive todo app and 4 learning guides
  • elevate-ts-samples - Production-ready examples (form validation, state management, list operations, workers)

Contributing

See CONTRIBUTING.md for details on how to contribute. Non-trivial contributions must be covered by the applicable contributor license agreement: CLA-INDIVIDUAL.md or CLA-CORPORATE.md.

License

Dual-licensed:

  • Public license: GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See LICENSE.
  • Commercial license: available from Zambit for customers who want to use elevate-ts in closed-source products or services. See COMMERCIAL-LICENSE.md.