Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
ramda-adjunct
Advanced tools
Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
Ramda-adjunct is a community-maintained extension of the Ramda library, providing additional utility functions that complement Ramda's core functionality. It offers a wide range of functions for data manipulation, validation, and functional programming.
Data Manipulation
The `partitionIndexed` function splits a list into two lists based on a predicate function that takes both the value and the index. This is useful for more complex partitioning logic.
const RA = require('ramda-adjunct');
const R = require('ramda');
const data = [1, 2, 3, 4, 5];
const result = RA.partitionIndexed((val, idx) => idx % 2 === 0, data);
console.log(result); // [[1, 3, 5], [2, 4]]
Validation
The `isNotNilOrEmpty` function checks if a value is neither null nor an empty string, array, or object. This is useful for validation checks in your application.
const RA = require('ramda-adjunct');
const isValid = RA.isNotNilOrEmpty('Hello');
console.log(isValid); // true
Functional Programming
The `curryN` function allows you to curry a function with a specified arity. This is useful for creating more flexible and reusable functions.
const RA = require('ramda-adjunct');
const R = require('ramda');
const add = (a, b, c) => a + b + c;
const curriedAdd = RA.curryN(3, add);
console.log(curriedAdd(1)(2)(3)); // 6
Lodash is a popular utility library that provides a wide range of functions for data manipulation, validation, and functional programming. It is more widely used and has a larger community compared to ramda-adjunct.
Underscore is another utility library similar to Lodash, offering a variety of functions for data manipulation and functional programming. It is older and less feature-rich compared to Lodash but still widely used.
Ramda is the core library that ramda-adjunct extends. It focuses on functional programming and immutability, providing a set of utility functions for working with data in a functional style.
Ramda 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.
For a full list of functions see the Documentation For The Latest Release.
Adjunct is a thing added to something else as a supplementary rather than an essential part. And that something is being ramda.
Follow Ramda Adjunct on medium.com/ramda-adjunct to read latest news and articles about the library.
Get professionally supported ramda-adjunct with Tidelift Subscription. |
npm i ramda-adjunct
or
yarn add ramda-adjunct
import * as RA from 'ramda-adjunct'
RA.isArray([]);
or
import { isArray } from 'ramda-adjunct';
isArray([]);
const RA = require('ramda-adjunct');
RA.isArray([]);
or
const { isArray } = require('ramda-adjunct');
isArray([]);
<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([]);
It'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.
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 libraries or in each codebases.
Ramda Adjunct maintains maximal code coverage and mimics Ramda's test patterns. You can trust our functions.
You 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.
Do you want to find out more about why this library exists ? Read this article.
Ramda Adjunct is being automatically tested against all LTS and Current Node.js versions.
We are building our npm distributions using Webpack/Babel to support legacy versions of node starting from 0.10.48. Although all tests are run against all LTS and Current Node.js versions, we rely on Webpack/Babel 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.
LATEST, PREVIOUS, ALL VERSIONS
If you want to contribute to this project, please consult the CONTRIBUTING.md guidelines.
Obtaining project copy
$ git clone https://github.com/char0n/ramda-adjunct
$ npm i
Running tests
$ npm run test
Running tests in browser
$ npm run test:web
Running compatibility tests for supported ramda versions
$ npm run test:ramda
Running code coverage numbers
$ npm run coverage
Running linter
We're using eslint and airbnb codestyle rules with prettier integrated as an eslint plugin.
$ npm run lint
$ npm run build:es
If 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.
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.
Tree 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.
import * as RA from 'ramda-adjunct';
RA.isArray([]); //=> true
import { isArray } from 'ramda-adjunct';
isArray([]); //=> true
These 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.
Although 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.
char0n (Vladimir Gorej)
https://www.linkedin.com/in/vladimirgorej/
This project exists thanks to all the people who contribute. [Contribute].
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 or Github Sponsors.
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
FAQs
Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
The npm package ramda-adjunct receives a total of 209,676 weekly downloads. As such, ramda-adjunct popularity was classified as popular.
We found that ramda-adjunct demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.