{"library":"radash","title":"Radash Utility Library","description":"Radash is a modern, functional utility library for JavaScript and TypeScript, providing a comprehensive collection of helper functions with zero external dependencies. It's designed to be simple, powerful, and fully typed, offering alternatives to functions found in older libraries like Lodash while focusing on a smaller bundle size and native ESM support. The library is actively maintained, currently on version 12.1.1, with frequent minor and patch releases. Key differentiators include its strong, native TypeScript typing, which aims to improve type safety compared to libraries that often require extra type packages, and a modular design that facilitates tree-shaking for optimized bundle sizes. Radash focuses on functions that augment modern JavaScript features, intentionally omitting those already well-covered by the language itself, leading to a cleaner and more intuitive API.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install radash"],"cli":null},"imports":["import * as _ from 'radash'","import { max, sum } from 'radash'","const { get } = require('radash')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import * as _ from 'radash'\n\nconst gods = [{\n  name: 'Ra',\n  power: 'sun',\n  rank: 100,\n  culture: 'egypt'\n}, {\n  name: 'Loki',\n  power: 'tricks',\n  rank: 72,\n  culture: 'norse'\n}, {\n  name: 'Zeus',\n  power: 'lightning',\n  rank: 96,\n  culture: 'greek'\n}]\n\n// Basic array operations\nconsole.log('Max rank god:', _.max(gods, g => g.rank));\nconsole.log('Total rank sum:', _.sum(gods, g => g.rank));\n\n// Object manipulation\nconst godObject = _.objectify(\n  gods, \n  g => g.name.toLowerCase(), \n  g => _.pick(g, ['power', 'rank', 'culture'])\n);\nconsole.log('Gods as object:', godObject);\n\n// Asynchronous operations with error handling\nconst mockApi = {\n  gods: {\n    findByName: async (name) => {\n      if (name === 'loki') throw new Error('Loki is elusive');\n      return gods.find(g => g.name.toLowerCase() === name);\n    }\n  }\n};\n\nasync function fetchAndLogGod(name) {\n  const [err, god] = await _.try(mockApi.gods.findByName)(name);\n  if (err) {\n    console.error(`Failed to fetch ${name}:`, err.message);\n  } else {\n    console.log(`Fetched ${name}:`, god);\n  }\n}\n\nfetchAndLogGod('ra');\nfetchAndLogGod('loki');","lang":"typescript","description":"This quickstart demonstrates core Radash functionalities including array manipulation (`max`, `sum`), object transformation (`objectify`, `pick`), and robust asynchronous error handling (`tryit`).","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}