Skip to content

RadashA new generation of functional utility library

A modern, simpler, more type-safe and powerful alternative to the old Lodash

Radash Logo

Radash Documentation

Welcome to the Radash documentation site! Radash is a powerful zero-dependency frontend utility library designed to solve the problems of Lodash's outdated maintenance and insufficient type support.

🚀 Get Started

Install

bash
npm install radash

Basic usage

typescript
import { range, tryit, select } from 'radash'

// Use range for iteration
for (const i of range(0, 10, 2)) {
  console.log(i) // 0, 2, 4, 6, 8, 10
}

// Use tryit for error handling
const [err, data] = await tryit(fetch)('/api/users')
if (err) {
  console.error('Failed to fetch users:', err)
  return
}

// Use select for data transformation and filtering
const users = await data.json()
const activeUsers = select(users,
  user => ({ ...user, status: 'active' }),
  user => user.isActive
)

📚 Documentation Structure

Getting Started

Array Functions

Handles array-related operations, including sorting, filtering, transformation, etc.

Async Functions

Handles asynchronous operations, including parallel execution, error handling, etc.

  • all - Execute all async operations in parallel
  • defer - Defer execution
  • guard - Async guard
  • map - Async map
  • reduce - Async reduce
  • retry - Retry mechanism
  • sleep - Delay function
  • tryit - Error handling

Curry Functions

Functional programming tools, including function composition, currying, etc.

Number Functions

Number processing tools.

Object Functions

Object manipulation tools.

Random Functions

Random number generation and random operations.

  • draw - Randomly draw element
  • random - Generate random number
  • shuffle - Shuffle array
  • uid - Generate unique ID
  • series - Generate series

String Functions

String processing tools.

Typed Functions

Type checking tools.

🎯 Features

  • Zero dependency: No external libraries required
  • TypeScript support: Complete type definitions
  • Modern: Uses the latest JavaScript features
  • High performance: Optimized algorithm implementations
  • Ease of use: Simple API design

📄 License

MIT License


Start using Radash to make your JavaScript/TypeScript development more efficient!

Released under the MIT License.