source: node_modules/ramda-adjunct/README.md

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 12.5 KB
RevLine 
[d24f17c]1[![Node.js workflow](https://github.com/char0n/ramda-adjunct/actions/workflows/nodejs.yaml/badge.svg)](https://github.com/char0n/ramda-adjunct/actions)
2[![codecov](https://codecov.io/gh/char0n/ramda-adjunct/branch/master/graph/badge.svg)](https://codecov.io/gh/char0n/ramda-adjunct)
3[![jsdoc](https://img.shields.io/badge/docs-100%25-green.svg)](https://char0n.github.io/ramda-adjunct/)
4[![npmversion](https://badge.fury.io/js/ramda-adjunct.svg)](https://www.npmjs.com/package/ramda-adjunct)
5[![npm](https://img.shields.io/npm/dm/ramda-adjunct.svg)](https://www.npmjs.com/package/ramda-adjunct)
6[![](https://data.jsdelivr.com/v1/package/npm/ramda-adjunct/badge)](https://www.jsdelivr.com/package/npm/ramda-adjunct)
7[![Dependabot enabled](https://img.shields.io/badge/Dependabot-enabled-blue.svg)](https://dependabot.com/)
8[![startwithwhy](https://img.shields.io/badge/start%20with-why%3F-brightgreen.svg?style=flat)](https://www.linkedin.com/pulse/ramda-adjunct-vladim%C3%ADr-gorej)
9[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/char0n/ramda-adjunct/issues)
10[![try on RunKit](https://img.shields.io/badge/try%20on-RunKit-brightgreen.svg?style=flat)](https://npm.runkit.com/ramda-adjunct)
11[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fchar0n%2Framda-adjunct.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fchar0n%2Framda-adjunct?ref=badge_shield)
12[![Backers on Open Collective](https://opencollective.com/ramda-adjunct/backers/badge.svg)](#backers)
13[![Sponsors on Open Collective](https://opencollective.com/ramda-adjunct/sponsors/badge.svg)](#sponsors)
14[![Join the chat at https://gitter.im/ramda-adjunct/Lobby](https://badges.gitter.im/ramda-adjunct/Lobby.svg)](https://gitter.im/ramda-adjunct/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
15[![Open Source Helpers](https://www.codetriage.com/char0n/ramda-adjunct/badges/users.svg)](https://www.codetriage.com/char0n/ramda-adjunct)
16[![Tidelift](https://tidelift.com/badges/package/npm/ramda-adjunct)](https://tidelift.com/subscription/pkg/npm-ramda-adjunct?utm_source=npm-ramda-adjunct&utm_medium=referral&utm_campaign=readme)
17
18# Ramda Adjunct [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Start%20your%20functional%20programming%20journey%20in%20JavaScript%20with%20ramda%20%2B%20ramda-adjunct&url=https%3A%2F%2Fgithub.com%2Fchar0n%2Framda-adjunct&via=vladimirgorej&hashtags=functional,javascript,ramda,utilities,addons)
19
20<p align="center"><img src="https://raw.githubusercontent.com/char0n/ramda-adjunct/master/logo.jpg" width="250" height="200" /></p>
21
22
23Ramda Adjunct is the most popular and most comprehensive set of functional utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
24
25For a full list of functions see the [**Documentation For The Latest Release**](https://char0n.github.io/ramda-adjunct).
26
27Adjunct is a thing added to something else as a supplementary rather than an essential part. And that something is being ramda.
28
29Follow Ramda Adjunct on [**medium.com/ramda-adjunct**](https://medium.com/ramda-adjunct) to read latest news and
30articles about the library.
31
32<table>
33 <tr>
34 <td align="right" valign="middle">
35 <img src="https://cdn2.hubspot.net/hubfs/4008838/website/logos/logos_for_download/Tidelift_primary-shorthand-logo.png" alt="Tidelift" width="60" />
36 </td>
37 <td valign="middle">
38 <a href="https://tidelift.com/subscription/pkg/npm-ramda-adjunct?utm_source=npm-ramda-adjunct&utm_medium=referral&utm_campaign=readme">
39 Get professionally supported ramda-adjunct with Tidelift Subscription.
40 </a>
41 </td>
42 </tr>
43</table>
44
45### Getting Started
46
47### Installation
48
49```sh
50npm i ramda-adjunct
51```
52or
53```sh
54yarn add ramda-adjunct
55```
56
57### Usage
58
59#### ES6
60
61```javascript
62import * as RA from 'ramda-adjunct'
63
64RA.isArray([]);
65```
66or
67```javascript
68import { isArray } from 'ramda-adjunct';
69
70isArray([]);
71```
72
73#### Node
74
75```javascript
76const RA = require('ramda-adjunct');
77
78RA.isArray([]);
79```
80or
81```javascript
82const { isArray } = require('ramda-adjunct');
83
84isArray([]);
85```
86
87#### Web browser
88
89```html
90<script src="ramda.js"></script>
91<script src="RA.web.js"></script>
92```
93or
94```html
95<script src="RA.web.standalone.js"></script>
96```
97
98Including Ramda Adjunct into HTML document exposes global variable **RA** on `window` object.
99
100```javascript
101RA.isArray([]);
102```
103
104## Motivation
105
106It's very common for people to create their own utils and recipes by composing Ramda's functions and creating more complex aggregate functions. Ramda Adjunct eliminates this repetitive wheel of reinvention and centralizes commonly used and useful utils.
107
108## Benefits
109
110### 1. Centralization
111
112All 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 libraries or in each codebases.
113
114### 2. Tests
115
116Ramda Adjunct maintains maximal code coverage and mimics Ramda's test patterns. You can trust our functions.
117
118### 3. Impeccable documentation
119
120You cannot call a library great if it lacks great documentation. Ramda Adjunct generates its documentation directly from its codebase and uses patterns found in both Ramda and Lodash to document its API.
121
122_Do you want to find out more about why this library exists ? Read this [**article**](https://www.linkedin.com/pulse/ramda-adjunct-vladim%C3%ADr-gorej)._
123
124## Requirements
125
126 - ramda >= 0.29.0
127 - node >= 0.10.48
128
129Ramda Adjunct is being automatically tested against all LTS and Current Node.js versions.
130
131### Legacy builds
132
133We are building our npm distributions using Webpack/Babel to support legacy versions of node starting from 0.10.48.
134Although all tests are run against all LTS and Current Node.js versions, we rely on Webpack/Babel to transpile ramda-adjunct into legacy ES5.
135It is also possible that our ES5 distributions run on node versions older than 0.10.48 as long as they support ES5.
136
137## API Documentation
138
139 [LATEST](https://char0n.github.io/ramda-adjunct),
140 [PREVIOUS](https://char0n.github.io/ramda-adjunct/4.1.0),
141 [ALL VERSIONS](./VERSIONS.md)
142
143## Wrote about us
144
145- [Ramda — R.adjust](https://medium.com/@kyletilman/ramda-r-adjust-b69a575274fa)
146- [Refactoring JavaScript: Imperative to Functional](https://www.derrickbeining.com/2018/07/04/refactoring-javascript-imperative-to-functional/)
147- [Functional Programming Unit Testing in Node – Part 5](http://jessewarden.com/2018/06/functional-programming-unit-testing-in-node-part-5.html)
148- [30 Seconds of Code: Rename MANY Object Keys in Javascript](https://medium.com/front-end-weekly/30-seconds-of-code-rename-many-object-keys-in-javascript-268f279c7bfa)
149- [Functional Javascript with Ramda](https://www.youtube.com/watch?v=ZP04zdDHPgk) associated with [slides](https://slides.com/jettdurham/functional-js#/)
150- [What's Ramda equivalent to underscore.js 'compact'?](https://stackoverflow.com/questions/29900130/whats-ramda-equivalent-to-underscore-js-compact)
151- [Ramda Adjunct](https://medium.com/ramda-adjunct/ramda-adjunct-6932c20e6b21)
152- [Lifting functions into monadic Context in JavaScript](https://www.linkedin.com/pulse/lifting-functions-monadic-context-javascript-vladim%C3%ADr-gorej/)
153- [Folding Promises in JavaScript](https://www.linkedin.com/pulse/folding-promises-javascript-vladim%C3%ADr-gorej/)
154- [Monad transformers in JavaScript](https://www.linkedin.com/pulse/monad-transformers-javascript-vladim%C3%ADr-gorej/)
155- [Functional lenses in JavaScript](https://www.linkedin.com/pulse/functional-lenses-javascript-vladim%C3%ADr-gorej/)
156- [Functional lenses in JavaScript - Isos](https://www.linkedin.com/pulse/functional-lenses-javascript-isos-vladim%C3%ADr-gorej/)
157- [Functional lenses in JavaScript - Traversables](https://www.linkedin.com/pulse/functional-lenses-javascript-traversables-vladim%C3%ADr-gorej/)
158- [Using JavaScript Generators to yield Promises](https://www.linkedin.com/pulse/using-javascript-generators-yield-promises-vladim%C3%ADr-gorej/)
159- [Integrating React Native navigators](https://blog.inspeerity.com/react-native/integrating-react-native-navigators/)
160- [Ramda Adjunct Changelog articles](https://medium.com/ramda-adjunct)
161- [Ramda and React](https://hint.io/blog/react-and-ramda)
162
163## Contributing
164
165If you want to contribute to this project, please consult the [CONTRIBUTING.md](https://github.com/char0n/ramda-adjunct/blob/master/CONTRIBUTING.md) guidelines.
166
167**Obtaining project copy**
168
169```sh
170 $ git clone https://github.com/char0n/ramda-adjunct
171 $ npm i
172```
173
174**Running tests**
175```sh
176 $ npm run test
177```
178
179**Running tests in browser**
180```sh
181 $ npm run test:web
182```
183
184**Running compatibility tests for supported ramda versions**
185```sh
186 $ npm run test:ramda
187```
188
189**Running code coverage numbers**
190```sh
191 $ npm run coverage
192```
193
194**Running linter**
195
196We're using [eslint](https://eslint.org/) and [airbnb codestyle](https://github.com/airbnb/javascript) rules with [prettier](https://prettier.io/) integrated as an eslint plugin.
197
198```sh
199 $ npm run lint
200```
201
202## Builds
203
204```sh
205 $ npm run build:es
206```
207
208If you use a bundler that supports tree shaking and ES2015 imports. `package.json` is automatically pre-configured to tell ES2015 `import` to import from this directory.
209
210`es/*` - ES5 code containing ES2015 imports.
211
212```sh
213 $ npm run build:commonjs
214```
215
216If you use node to import ramda-adjunct. `package.json` is automatically pre-configured to tell `require` to import from this directory.
217
218`lib/*` - ES5 code containing `commonjs` imports.
219
220```sh
221 $ npm run build:umd
222```
223
224The command will create three types of bundles.
225
226`dist/RA.node.js` - ES5 compliant bundle, running on all node versions.
227
228`dist/RA.web.js` - ES5 compliant bundle, running in browsers. Requires `ramda.js` to be required before.
229
230`dist/RA.web.standalone.js` - ES5 compliant bundle, running in browsers. It has `ramda.js` pre-bundled.
231
232You can always find fresh build files in exposed as artifacts of GitHub Actions.
233
234
235## Tree shaking support
236
237Tree shaking is a term commonly used in a JavaScript context for dead-code elimination. It relies on the static structure of ES2015's module syntax, i.e. `import` and `export`. Ramda Adjunct natively supports tree shaking thanks to the way the code is organized and its use of ES2015 imports.
238
239```javascript
240 import * as RA from 'ramda-adjunct';
241
242 RA.isArray([]); //=> true
243```
244```javascript
245 import { isArray } from 'ramda-adjunct';
246
247 isArray([]); //=> true
248```
249
250These two statements are equivalent and _only_ `isArray` should be incorporated into your bundle. You can pick and choose the functions you need without worrying about the whole library being included in your build.
251
252## Assimilated libraries
253
254 - [rcb](https://github.com/enten/rcb) - Ramda Cookbook implementation
255
256## Typescript support
257
258Although Ramda Adjunct is written in ES2016, we also support **Typescript**. When Ramda Adjunct gets imported into a Typescript project, typings are automatically imported and used.
259
260## Author
261
262 char0n (Vladimir Gorej)
263
264 vladimir.gorej@gmail.com
265
266 https://www.linkedin.com/in/vladimirgorej/
267
268### Contributors
269
270This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
271<a href="https://github.com/char0n/ramda-adjunct/graphs/contributors"><img src="https://opencollective.com/ramda-adjunct/contributors.svg?width=890" /></a>
272
273## Support us
274
275Although 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](https://opencollective.com/ramda-adjunct) or [Github Sponsors](https://github.com/sponsors/char0n).
276
277[![Support via Open Collective](https://opencollective.com/ramda-adjunct/tiers/backer.svg?avatarHeight=36)](https://opencollective.com/ramda-adjunct/donate)
278
279
280## Backers
281
282Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/ramda-adjunct#backer)]
283
284<a href="https://opencollective.com/ramda-adjunct#backers" target="_blank"><img src="https://opencollective.com/ramda-adjunct/backers.svg?width=890"></a>
285
286
287## Sponsors
288
289Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/ramda-adjunct#sponsor)]
290
291<a href="https://opencollective.com/ramda-adjunct/sponsor/0/website" target="_blank"><img src="https://opencollective.com/ramda-adjunct/sponsor/0/avatar.svg"></a>
292
293
294### License
295[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fchar0n%2Framda-adjunct.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fchar0n%2Framda-adjunct?ref=badge_large)
Note: See TracBrowser for help on using the repository browser.