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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sekwiatkowski/js-fp

v0.18.2

Published

A pragmatic functional programming library for JavaScript/TypeScript

Downloads

7

Readme

JS/FP

A pragmatic functional programming library for JavaScript/TypeScript

Computation with monad(-like) objects

Computation with one or two values

Box: computation with one value

Pair: computation with two values

Computation with n values

List: computation with zero, one or more values

NonEmptyList: computation with one or more values

Computation with error handling

Option: computation with a value that may be present or absent

Result: synchronous computation that may succeed or fail, short-circuits when a failure occurs

Validated: like Result, but accumulates errors instead of short-circuiting

Computation with a value and a context

State: stateful computation

Writer: computation with additional data (used for logging)

Writers

StringWriter: computation with log entries concatenated to a string

ListWriter: computation with log entries concatenated to a List instance

Asynchronous computation

Future: asynchronous computation that may succeed or fail (a monadic alternative to Promises)

High-level computation

Program: interpretation of program descriptions

Functions

Action: wrapper around a function with no parameters that enables composition

Arrow: wrapper around a function with one or more parameters that enables composition and adaptation of the input

Combination

Combination with semigroups

Semigroup: a type that supports an associative binary operation

objectCombination: a function to create combination schemes for objects based on semigroups

Combination with monoids

Monoid: a semigroup with an identity element

Boolean

All: combines two booleans using logical AND

Any: combines two booleans using logical OR

Number

Min: combines two numbers, resulting in the smallest of the two

Max: combines two numbers, resulting in the largest of the two

Sum: combines two numbers, resulting in the sum of the two

Product: combines two numbers, resulting in the product of the two

Date

Earliest: combines two dates, resulting in the earlier of the two

Latest: combines two dates, resulting in the later of the two

String

StringConcatenation: combines two string using concatenation

Array

ArrayConcatenation: combines two arrays using concatenation

List

ListConcatenation: combines two lists using concatenation

Testing

Equivalence

Equivalence: testing of equivalence between two values of the same type

objectEquivalence: a function to create equivalence schemes for objects based on member equivalences

Equalities for basic types: equalities for string, number, boolean and Date values and arrays of such values

Order

Order: decision on the order of two values

Ordering: a type alias for the three possible outcomes (-1, 0 and 1)

Predicate

Predicate: wrapper around predicate functions