Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tommmyy/ramda-extension
🤘Utility library for functional JavaScript. With ❤️ to Ramda.
https://github.com/tommmyy/ramda-extension
extensions functional-programming pointfree ramda ramda-extension ramda-functions tools toolset utilities utils
Last synced: about 1 month ago
JSON representation
🤘Utility library for functional JavaScript. With ❤️ to Ramda.
- Host: GitHub
- URL: https://github.com/tommmyy/ramda-extension
- Owner: tommmyy
- License: apache-2.0
- Created: 2016-11-15T10:23:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T13:54:40.000Z (over 1 year ago)
- Last Synced: 2024-10-28T14:59:41.504Z (about 2 months ago)
- Topics: extensions, functional-programming, pointfree, ramda, ramda-extension, ramda-functions, tools, toolset, utilities, utils
- Language: HTML
- Homepage: https://ramda-extension.web.app/
- Size: 9.27 MB
- Stars: 167
- Watchers: 7
- Forks: 24
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-fp-js - Ramda-extension - free functions composed only from Ramda functions. (Libraries)
README
Ramda extension
🤘🤘🤘Utility library for functional JavaScript.
Library adds utilities functions that are built on the top of marvelous Ramda library.
Play wit Ramda and Ramda-extension in REPL.
```js
import { cx } from 'ramda-extension';cx({ box: true, 'box--outline': false }, 'width-100'); // ".box .width-100"
```## Why to choose ramda-extension over other libraries?
We focus on functional point-free code. Our goal is to keep codebase composed only from ramda functions, not from own code. Basically, we are using only `const` and `ES6 modules` from the JavaScript itself.
We have a few functions with side-effects (like `log` and `trace`) to support better developer's experience in debugging process. It is only for development purpose and it should not be used in production code.
## Installation
```bash
$ yarn add ramda ramda-extension
```
or```bash
$ npm install ramda ramda-extension
```## Usage
We support CommonJS and ES modules syntax.
Import function as a named export (not recommended without [treeshaking](https://webpack.js.org/guides/tree-shaking/)):
```js
import { toKebabCase } from 'ramda-extension';
import { flatten } from 'ramda'; // standard ramda function (if needed)toKebabCase('I wanna eat my kebab.') // "i-wanna-eat-my-kebab"
flatten([1, 2, [3, 4], 5]) // [1, 2, 3, 4, 5]
```
* NOTE: standard ramda functions are still accessed via 'ramda'Alternatively you can import it separately if your environment doesn't support treeshaking (Sse [babel-plugin-transform-imports](https://www.npmjs.com/package/babel-plugin-transform-imports)):
```js
import toKebabCase from 'ramda-extension/lib/toKebabCase';toKebabCase('I wanna eat my kebab.') // "i-wanna-eat-my-kebab"
```If you prefer jQuery-style:
```js
import * as R_ from 'ramda-extension'R_.toKebabCase('I wanna eat my kebab.') // "i-wanna-eat-my-kebab"
```_NOTE_: Ramda itself is not part of bundle, you need to add it manually
## CDN
You can use Ramda-extension directly in the browser:```html
```
## Articles & Resources
- [Why are we not afraid to think functionally with Ramda?](https://medium.com/@tyna.kamenicka/why-are-we-not-afraid-to-think-functionally-with-ramda-fb17f733fde8#c898-5ab767b22b17)
## Contributing
Most of the functions have its own tests and examples in the JS Doc.
Feel free to either contribute yourself or submit an issue if there is a bug or you have an idea for a new extension.
We are open to all ideas and suggestions, feel free to open an issue or a pull request!
See the [contribution guide](https://github.com/tommmyy/ramda-extension/blob/master/CONTRIBUTING.md) for guidelines.
## License
All packages are distributed under the Apache 2.0 license. See the license [here](https://github.com/tommmyy/ramda-extension/blob/master/LICENSE).