🚀 A lightweight TypeScript utility library inspired by lodash.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
docs
spec
src
tasks
types
.editorconfig
.gitattributes
.gitignore
.npmignore
.prettierrc
CODE_OF_CONDUCT.md
LICENSE
README.md
jsdoc.json
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

lightdash

A lightweight TypeScript utility library inspired by lodash.

Introduction

Lightdash is an extensive collection of utility functions written in TypeScript, designed to be lightweight and modern. It's heavily inspired by lodash and underscore, but with the goal to be tiny and as fast as possible. It is completely written from scratch with the latest ES8+ features.

Docs

Differences from lodash

Pros:

  • Written in TypeScript, built-in TypeScript definitions.
  • Smaller fil sizes, both when using the full build and when tree-shaking.
  • Makes use of the latest ECMAScript/TypeScript features.

Cons:

  • No support for legacy browsers.

Usage

Installation:

npm install lightdash

Importing the modules you want from the file fitting your environment (lightdash.esm.js for ES modules or lightdash.common.js for commonjs/node) is highly recommended to drastically reduce file size by only including the functions actually needed.

When using ES Modules:

import { arrDifference } from "lightdash";

arrDifference([1, 2, 3], [1, 3]);

When using Node/CommonJS:

const { arrDifference } = require("lightdash");

arrDifference([1, 2, 3], [1, 3]);

If you use lightdash directly in the browser, use the exposed _l variable

_l.arrDifference([1, 2, 3], [1, 3]);

Updating

v9.x -> v10.x

Breaking:

  • changed entry iteration from key,val,index,obj to val,key,obj
  • removed isArray and strFromCamelCase (use Array.isArray and strFromPascalCase instead)
  • removed "immediate" param for fn* methods

v8.x -> v9.x

Breaking:

  • Merged arrRemoveItem and arrRemoveItemFirst
  • Removed isArguments and isNull
  • Removed numSum, numMedian and numAverage
  • Removed fnCurry
  • Removed hasPath

Contributing

Contributions are always welcome, no matter if you have a requests, an idea, found a bug, or spotted a typo: Feel free to create a PR or open an issue!