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

halcyon

v0.19.1

Published

A better Standard Library for JavaScript

Downloads

6,393

Readme

Halcyon

Build Status dependencies Status

Check out the API docs!

The missing standard library for JavaScript. This lightweight library is meant to fill the gap between Ramda (functional) and Lodash (performance) while providing you with the tools you need to write sane JavaScript. This means that all functions are immutable, auto-curried, and designed for composition by expecting data last.

  1. Why
  2. Usage
  3. Comparisons

Why?

First Class Functional Programming

Halcyon's guiding principle is to support and encourage functional programming styles. Unlike some other libraries that simply offer FP-ish wrappers, functional programming is a first class citizen in Halcyon. This means that every function is immutable, auto-curried, and written to expect data last to facilitate composition. Halcyon also compares objects by value, not reference, which allows you to start working with data in a meaningful way without concerning yourself with how it's stored in memory.

Built for the Next Generation of JavaScript

The Halcyon codebase is written with ES2015 modules and packaged with rollup, allowing you to take advantage of tree shaking to produce slimmer bundles without the need for extra tooling.

Usage

npm i --save halcyon

After that's done, just import it in your code and get on to building awesome stuff. If you haven't already done so, you should check out the API documentation to see what functions are available and learn how to use them. With that out of the way, here are two of the most common ways to use Halcyon:

ES2015 Module

import * as _ from 'halcyon'   // import everything
import { prop } from 'halcyon' // or just what you need

const getName = _.prop('name')
_.map(getName, [{ name: 'Dwight' }, { name: 'Jim' }]) // => ['Dwight', 'Jim']

Installer

If you have full control over your codebase and don't want to continually import/prefix all of the functions, you can install the library to a context.

import install from 'halcyon/installer'

// Node/Webpack/etc:
install(global)

// Directly in the browser:
install(window)

// Now all of the functions are available on the scope you installed it to:
prop('name', { name: 'Michael' }) // => 'Michael'

Comparisons

Category | Halcyon | Ramda | Lodash | Lodash-FP --------------- | -------- | ----- | --------- | --------- Minified (kb) | 10.1 | 41.1 | 70.1 | 81.2 100% Immutable | Yes | Yes | No | Yes Auto-Curry | Yes | Yes | No | Yes Object Equality | Value | Value | Reference | Reference IE 9+ | Yes | Yes | Yes | Yes