Package detail

@newdash/newdash

newdash44.5kMIT5.23.1

javascript/typescript utility library

javascript, typescript, lodash, utilities

readme

NewDash

Github CI Deno CI

Codecov Quality Gate Status Security Rating Netlify

npm (scoped) npm (scoped) npm (scoped) npm (scoped) npm (scoped)

NewDash is a hard fork of the lodash utility project, and re-build it with typescript.

Quick Start

ESM

import first from "@newdash/newdash-es6/first" // only load `first` function
first("abc")
// => "a"

NodeJS

works as you want.

// const { first } = require("@newdash/newdash")
const { first } = require("@newdash/newdash/first") // Compatible with es6 module
first("abc")
// => "a"

ES6 or Typescript

// import { first } from "@newdash/newdash" // load all functions of @newdash
import first from "@newdash/newdash/first" // only load `first` function
first("abc")
// => "a"

Deno Runtime

import from CDN, remember to add .ts suffix.

// import { add } from "https://cdn.jsdelivr.net/npm/@newdash/newdash-deno/index.ts"
import { add } from "https://cdn.jsdelivr.net/npm/@newdash/newdash-deno/add.ts"

add(1, 2)
// => 3
add('1', '2')
// => '12'
add('1', 2) // different types
// throw error: TS2345 [ERROR]: Argument of type '2' is not assignable to parameter of type '"1"'.

UMD Module (Browser Native)

just introduce script with html.

<script src="https://cdn.jsdelivr.net/npm/@newdash/newdash-umd/newdash.min.js"></script>

API Document

Highlight

  • concurrency/limit - limit concurrency of async operations
  • Mutex - exclusive executing
  • hash - hash js object to stable string (MD5 based)
  • fallback - fallback functions for resilience
  • LRUMap and TTLMap - Map implementations which concern about eviction

Different Release

In most cases, just use the @newdash/newdash package is enough.

  • @newdash/newdash - for modern nodejs environment, ready for all build tools which based on the nodejs commonjs module system (node, react, vuejs, webpack and more).
  • @newdash/newdash-deno - for deno language support, with some transform, like add the '.ts' suffix for modules.
  • @newdash/newdash-es5 - for old nodejs environment, ready for 0.12 <= node version <= 8.
  • @newdash/newdash-es6 - for modern build system, with es6 module keywords so that build tool could strip the unused modules.
  • @newdash/newdash-umd - for native browser without any build system, please access it with unpkg or jsdeliver

CHANGELOG

LICENSE

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

5.23.1 (2024-06-08)

Bug Fixes

5.23.0 (2024-06-08)

Features

5.22.1 (2024-04-25)

5.22.0 (2023-04-15)

Features

Bug Fixes

5.22.0-0 (2022-12-03)

Features

Bug Fixes

5.21.4 (2022-08-12)

Bug Fixes

5.21.3 (2022-07-20)

Bug Fixes

5.21.2 (2022-03-28)

5.21.1 (2022-02-24)

Bug Fixes

5.21.0 (2021-12-22)

Features

Bug Fixes

5.20.0 (2021-10-07)

Features

Bug Fixes

5.19.0 (2021-06-17)

Features

Bug Fixes

5.18.0 (2021-04-07)

Features

Bug Fixes

5.17.1 (2020-11-04)

Bug Fixes

5.17.0 (2020-11-03)

Features

Bug Fixes

5.16.0 (2020-10-22)

Features

Bug Fixes

5.15.0 (2020-10-10)

Features

Bug Fixes

5.14.0 (2020-09-29)

Features

Bug Fixes

5.13.0 (2020-08-11)

Features

Bug Fixes

5.12.2 (2020-08-08)

Bug Fixes

  • types definition of map (1720ad2)

5.12.1 (2020-08-03)

Bug Fixes

5.12.0 (2020-07-16)

Features

Bug Fixes

5.11.0 (2020-07-14)

Features

Bug Fixes

5.10.0 (2020-07-02)

Features

5.9.0 (2020-07-02)

Features

Bug Fixes

5.8.0 (2020-06-27)

Features

5.7.0 (2020-06-26)

Features

Bug Fixes

5.6.0 (2020-06-11)

Features

Bug Fixes

5.5.0 (2020-06-10)

Features

Bug Fixes

5.4.1 (2020-06-02)

Bug Fixes

5.4.0 (2020-06-02)

Features

5.3.0 (2020-06-01)

Features

5.2.0 (2020-06-01)

Features

5.1.4 (2020-05-29)

Bug Fixes

5.1.3 (2020-05-29)

Bug Fixes

5.1.2 (2020-05-29)

5.1.1 (2020-05-29)

Bug Fixes

5.1.0 (2020-05-29)

Features

Bug Fixes

0.0.4 (2020-05-29)

Features

Bug Fixes