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

pristine-fp

v0.1.1

Published

A collection of functional programming utilities inspired by Underscore and Functional JavaScript

Readme

pristine‑fp

A tree‑shakable collection of functional utilities for JavaScript/TypeScript, designed to be modular, pragmatic, and deeply inspired by the functional programming discipline.

Purpose

This package extracts the functional utilities originally developed inside @cyril2day2/pristine‑ui into a standalone, dependency‑managed library. The goal is to provide a clean, focused set of functions that can be used in any JavaScript project while keeping the UI component library free from utility “pollution”.

Features

  • Tree‑shakable – every function can be imported individually; unused code is eliminated by modern bundlers.
  • Modular – organized into logical categories (core, collections, objects, higher‑order, validation, vue helpers, etc.).
  • TypeScript‑ready – full type definitions included.
  • Underscore integration – leverages underscore for foundational operations (e.g., isObject, has, every) while adding higher‑level functional patterns.
  • Zero side‑effects – the package declares "sideEffects": false for optimal bundling.

Installation

npm install pristine-fp
# or
pnpm add pristine-fp
# or
yarn add pristine-fp

Usage

Import only the functions you need:

import { deepClone, compose, curry, partial } from 'pristine-fp';

Or import from a sub‑category (even finer‑grained tree‑shaking):

import { deepClone } from 'pristine-fp/objects';
import { compose } from 'pristine-fp/core';
import { classIf } from 'pristine-fp/vue';

Categories

| Category | Description | |----------------|-----------------------------------------------------------------------------| | core | Fundamental functional combinators (compose, curry, identity, etc.) | | collections | Utilities for arrays and iterable data (mapcat, repeat, freq, etc.) | | objects | Object‑specific helpers (deepClone, deepFreeze, hasKeys, merge, …) | | higher‑order | Functions that create or transform other functions (partial, dispatch, …) | | validation | Predicate builders and validators (checker, validator) | | vue | Vue‑specific helpers (classIf, presenceAttr) | | underscore | Re‑exports of selected underscore functions for convenience |

Credits & Inspiration

  • Underscore.js – many low‑level object/collection utilities are direct re‑exports or thin wrappers around underscore’s battle‑tested functions.
  • Functional JavaScript – ideas drawn from the book “Functional JavaScript: Introducing Functional Programming with Underscore.js” by Michael Fogus (O’Reilly, ISBN‑10: 1449360726). In particular, the patterns for function‑building functions, invokers, pluckers, and dispatchers follow the style presented in that work.
  • JavaScript Allongé, the “Six” Edition – concepts and patterns inspired by Reg “raganwald” Braithwaite’s book JavaScript Allongé (LeanPub, https://leanpub.com/read/javascriptallongesix), especially its treatment of function composition, closures, and functional combinators.
  • Real‑world refactoring – the library emerged from the practical need to keep the pristine‑ui component library lean and focused, demonstrating how functional utilities can be cleanly separated from UI concerns.

License

MIT – see LICENSE file.