
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
ramda-extension
Advanced tools
Library adds utilities functions that are built on the top of marvelous Ramda library.
Play wit Ramda and Ramda-extension in REPL.
import { cx } from 'ramda-extension';
cx({ box: true, 'box--outline': false }, 'width-100'); // ".box .width-100"
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.
$ yarn add ramda ramda-extension
or
$ npm install ramda ramda-extension
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]
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
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>
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.
All packages are distributed under the Apache 2.0 license. See the license here.
FAQs
Helpful functions built on top of the mighty Ramda
We found that ramda-extension demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.