Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
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.
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.
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.
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:
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']
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'
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 |
FAQs
A better Standard Library for JavaScript
The npm package halcyon receives a total of 709 weekly downloads. As such, halcyon popularity was classified as not popular.
We found that halcyon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.