/ramda-adjunct

Adjunct is a thing added to something else as a supplementary rather than an essential part. And that something is being ramda.

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

CircleCI codecov jsdoc npm version npm devDependencies Status peerDependencies Status NSP Status Greenkeeper badge start with why contributions welcome try on RunKit FOSSA Status Open Collective Join the chat at https://gitter.im/ramda-adjunct/Lobby

Ramda Adjunct

This library is a community maintained extension of Ramda.

Support us

Although we love working on ramda-adjunct, we must invest our free time to make this library great. Support this project's evolution via Open Collective.

Support via Open Collective

Motivation

It seems to be very common for people to create their own utils and recipes composing the Ramda functions and creating yet more complex aggregate functions. Ramda Adjunct tries to eliminate this repetitive wheel of reinvention and centralize most aggregate utils in its codebase.

Benefits

As a maintainers, we see three main benefits in Ramda Adjunct.

Centralization

All Ramda recipes and aggregate utils not present in Ramda are centralized here. There is no more need for everybody to create their own utils in their own codebases.

Tests

Creating custom aggregate utils or implementing recipes from Ramda wiki creates the defectiveness problem. The problem is caused by the absence of any tests. Ramda Adjunct keeps 100% code coverage and mimics the Ramda test patterns.

Impeccable documentation

You cannot call a library great without a great documentation. Ramda Adjnuct generates its documentation directly from its codebase and uses patterns both found in Ramda and Lodash to document its API.

Do you want to find out more why this library exists ? Read this article.

Requirements

  • ramda >= 0.19.0
  • node >= 0.10.48

Ramda Adjunct is being automatically tested against node version >=6 <=9.

Legacy builds

We are building our npm distributions by Webpack to support also legacy versions of node starting from 0.10.48. Although all tests are run only against node version >=4 <=8, we rely on Webpack to transpile ramda-adjunct into legacy ES5. It is also possible that our ES5 distributions run on node versions older than 0.10.48 as long as they support ES5.

Installation

 $ npm i ramda-adjunct

API Documentation

0.0.1, 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.1, 0.6.0, 0.7.0, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.9.0, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.13.0, 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.19.0, 2.0.0, 2.1.0, LATEST

Development

If you want to contribute to this project, please consult the CONTRIBUTING.md guideline.

Obtaining project copy

 $ git clone https://github.com/char0n/ramda-adjunct
 $ npm i

Running tests

 $ npm run test

Running linter

 $ npm run lint

Builds

 $ npm run build:es

If you use bundler that supports tree shaking and ES2015 imports. package.json is automatically pre-configured to tell ES2015 import to import from this directory.

es/* - ES5 code containing ES2015 imports

 $ npm run build:commonjs

If you use node to import ramda-adjunct. package.json is automatically pre-configured to tell require to import from this directory.

lib/* - ES5 code containing commonjs imports

 $ npm run build:umd

The command will create three types of bundles.

dist/RA.node.js - ES5 compliant bundle, running on all node versions

dist/RA.web.js - ES5 compliant bundle, running in browsers. Requires ramda.js to be required before

dist/RA.web.standalone.js - ES5 compliant bundle, running in browsers. It has ramda.js pre-bundled

You can always find fresh build files in circle-ci artifacts.

Usage

Web browser

<script src="ramda.js"></script>
<script src="RA.web.js"></script>

or

<script src="RA.web.standalone.js"></script>

Including Ramda Adjunct into HTML document exposes global variable RA on window object.

RA.isArray([]);

Node

const RA = require('ramda-adjunct');

RA.isArray([]);

or

const { isArray } = require('ramda-adjunct');

isArray([]);

Tree shaking support

Tree shaking is a term commonly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module syntax, i.e. import and export. Ramda Adjunct natively supports tree shaking thanks to the way the code is organized and the fact that it is using ES2015 imports.

  import * as RA from 'ramda-adjunct';

  RA.isArray([]); //=> true
  import { isArray } from 'ramda-adjunct';

  isArray([]); //=> true

These two statements are equivalent and only isArray util should be incorporated into your bundle, not entire Ramda Adjunct.

Assimilated libraries

  • rcb - Ramda Cookbook implementation

Typescript support

Although Ramda Adjunct is written in ES2016, we support Typescript. When Ramda Adjunct gets imported into Typescript project, typings are automatically imported and used.

Author

char0n (Vladimir Gorej)

vladimir.gorej@gmail.com

https://www.linkedin.com/in/vladimirgorej/

Contributors

License

FOSSA Status