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 easily composable.
Redash is designed to encourage functional programming styles without sacrificing the utility you're used to. What sets it apart is that, unlike some other libraries that simply offer FP-ish wrappers, functional programming is a first class citizen in Redash. Here's what that means for you:
The Redash codebase is written with ES2015 modules and packaged with rollup so you to take advantage of tree shaking without the need for extra tooling. Redash also offers complete typings for TypeScript users so that you can work with its API with complete confidence.
One pain point often arises when working with JavaScript in a more functional style: debugging. Ever encounter stack traces with multiple frames of unintelligible function calls? This problem is exacerbated by composition, something we should be encouraging. Redash attempts to improve this experience by enhancing function names to describe their curried arguments. Let's take a look:
import _ from 'lodash/fp'
import R from 'redash'
const getNames = _.map(_.get('name'))
console.log(getNames.toString()) // => 'function uu(n,t){\n/* [wrapped with…*/\nreturn(af(n)?l:Yt)(n,je(t,3))}'
const getNames_ = R.map(R.get('name'))
console.log(getNames_.toString()) // => 'map(get("name"))'
npm i --save redash
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. Here are a few of the most common ways to use Redash:
import { map, get } from 'redash'
map(get('name'), [{ 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 'redash/installer'
install(global)
// Now all of the functions are available on the scope you installed it to:
get('name', { name: 'Michael' }) // => 'Michael'
Category | Redash | Ramda | Lodash | Lodash/FP |
---|---|---|---|---|
Minified (kb) | 14.8 | 44.7 | 71.1 | 82.4 |
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 redash receives a total of 14 weekly downloads. As such, redash popularity was classified as not popular.
We found that redash 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.