Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remeda

Package Overview
Dependencies
Maintainers
2
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remeda

A utility library for JavaScript and Typescript.

  • 2.17.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
416K
decreased by-14.11%
Maintainers
2
Weekly downloads
 
Created

What is remeda?

Remeda is a utility library for JavaScript and TypeScript that provides a collection of functions for working with arrays, objects, and other data types. It is designed to be a modern, functional alternative to libraries like Lodash, with a focus on immutability and type safety.

What are remeda's main functionalities?

Array Manipulation

Remeda provides a variety of functions for manipulating arrays, such as `filter`, `map`, and `reduce`. These functions can be composed using `R.pipe` to create complex transformations in a readable and functional style.

const arr = [1, 2, 3, 4, 5];
const result = R.pipe(
  arr,
  R.filter(x => x % 2 === 0),
  R.map(x => x * 2)
);
console.log(result); // [4, 8]

Object Manipulation

Remeda includes functions for working with objects, such as `omit`, `pick`, and `merge`. These functions allow you to create new objects with specific properties removed, selected, or combined.

const obj = { a: 1, b: 2, c: 3 };
const result = R.omit(obj, ['b']);
console.log(result); // { a: 1, c: 3 }

Functional Programming

Remeda supports functional programming techniques, such as partial application and currying. The `partial` function allows you to create new functions with some arguments pre-filled, making it easier to create reusable and composable functions.

const add = (a, b) => a + b;
const add10 = R.partial(add, 10);
console.log(add10(5)); // 15

Type Safety

Remeda is designed with TypeScript in mind, providing type-safe functions that help catch errors at compile time. This ensures that your code is more robust and less prone to runtime errors.

const arr: number[] = [1, 2, 3, 4, 5];
const result = R.map(arr, x => x * 2);
console.log(result); // [2, 4, 6, 8, 10]

Other packages similar to remeda

Keywords

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc