0.12.0 ā€¢ Published 2 years ago

ramda-extension v0.12.0

Weekly downloads
2,402
License
Apache-2.0
Repository
github
Last release
2 years ago
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

$ yarn add ramda ramda-extension

or

$ npm install ramda ramda-extension

Usage

We support CommonJS and ES modules syntax.

Import function as a named export (not recommended without treeshaking):

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):

import toKebabCase from 'ramda-extension/lib/toKebabCase';

toKebabCase('I wanna eat my kebab.') // "i-wanna-eat-my-kebab"

If you prefer jQuery-style:

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:

<script src="https://cdn.jsdelivr.net/npm/ramda@latest/dist/ramda.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ramda-extension@latest/dist/ramda-extension.min.js"></script>

Articles & Resources

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 for guidelines.

License

All packages are distributed under the Apache 2.0 license. See the license here.

0.12.0

2 years ago

0.11.0

4 years ago

0.10.3

5 years ago

0.10.2

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago