# the-lodash

> Extension to Lodash library

Latest version **3.0.3** (published 2026-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install the-lodash
pnpm add the-lodash
yarn add the-lodash
bun add the-lodash
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2026-07-07 |
| First published | 2018-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 64.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Ruben Hakopian |
| Maintainers | rubenhak |

## Links

- npm: https://www.npmjs.com/package/the-lodash
- Repository: https://github.com/rubenhak/nodejs-the-lodash
- Homepage: https://github.com/rubenhak/nodejs-the-lodash#readme
- Issues: https://github.com/rubenhak/nodejs-the-lodash/issues
- npm.io page: https://npm.io/package/the-lodash

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) 4.18.1
- [@types/lodash](https://npm.io/package/@types/lodash.md) 4.17.24
- [fast-deep-equal](https://npm.io/package/fast-deep-equal.md) 3.1.3
- [fast-json-stable-stringify](https://npm.io/package/fast-json-stable-stringify.md) 2.1.0

## Recent versions

- 3.0.3 (latest) — 2026-07-07
- 3.0.2 — 2026-07-07
- 3.0.1 — 2026-07-07
- 2.1.2 — 2023-04-04
- 2.1.1 — 2023-04-04
- 2.1.0 — 2023-04-04
- 2.0.12 — 2023-01-06
- 2.0.11 — 2022-12-28
- 2.0.10 — 2022-12-28
- 2.0.9 — 2021-03-31
- 2.0.8 — 2021-03-10
- 2.0.7 — 2021-03-04
- 2.0.6 — 2021-03-04
- 2.0.5 — 2021-03-04
- 2.0.4 — 2021-03-04
- … 21 more at https://npm.io/package/the-lodash/versions

## README

# Lodash Extender

[![Build Status](https://travis-ci.org/rubenhak/nodejs-the-lodash.svg?branch=master)](https://travis-ci.org/rubenhak/nodejs-the-lodash)

Library meant to extend capabilites of NodeJS Lodash library.

## _.makeDict
Create a dictionary object from array.




**Signature:**

_.makeDict(array, cbKey, cbValue) : returns dict.

**array**: array of items

**cbKey**: function to return key of each item.

**cbValue**: optional callback to set value for each item. if not set the value would be the item itself.

**Usage 1:**
```js
var items = ['cat', 'dog', 'elephant']
var dict = _.makeDict(items, x => x, x => x.length);
console.log(dict);
```

Outputs:
```
{
    "cat": 3,
    "dog": 3,
    "elephant": 8,
}
```

**Usage 2:**
```js
var items = [
    { id: 1, name: 'cat' }, 
    { id: 3, name: 'dog' }, 
    { id: 4, name: 'elephant' }
]
var dict = _.makeDict(items, x => x.id, x => ({ name: x.name }));
console.log(dict);
```

Outputs:
```
{
    1: {
        "name": "cat"
    },
    3: {
        "name": "dog"
    },
    4: {
        "name", "elephant"
    }
}
```


## Publishing

```sh
$ ./publish.sh
```

### Updating NPM Key
```sh
$ travis encrypt <NPM-KEY-GOES-HERE> --add deploy.api_key
```

---
_Source: https://npm.io/package/the-lodash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
