# @technically/lodash

> Dual ESM/CommonJS wrapper around lodash

Latest version **4.17.0** (published 2023-05-07) · MIT license · 50.9K weekly downloads

## Install

```sh
npm install @technically/lodash
pnpm add @technically/lodash
yarn add @technically/lodash
bun add @technically/lodash
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.17.0 |
| Published | 2023-05-07 |
| First published | 2023-05-07 |
| Weekly downloads | 50.9K |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Ivan Voskoboinyk |
| Maintainers | e1npm |
| Keywords | lodash, esm, commonjs, dual |

## Links

- npm: https://www.npmjs.com/package/@technically/lodash
- Repository: https://github.com/technically-js/lodash
- Homepage: https://github.com/technically-js/lodash#readme
- Issues: https://github.com/technically-js/lodash/issues
- npm.io page: https://npm.io/package/@technically/lodash

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.0
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.0
- [@types/lodash-es](https://npm.io/package/@types/lodash-es.md) ^4.17.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads
- [@fremtind/jkl-core](https://npm.io/package/@fremtind/jkl-core.md) — 4.2K weekly downloads

## Recent versions

- 4.17.0 (latest) — 2023-05-07
- 4.0.0-alpha (next) — 2023-05-07
- 4.16.0 — 2023-05-07
- 4.15.0 — 2023-05-07
- 4.14.0 — 2023-05-07

## README

# ESM/CommonJS wrapper around lodash

This is a "temporary" workaround until `lodash-es` will be merged into `lodash`.

See https://github.com/lodash/lodash/issues/5107

This package relies on [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) 
to provide the right lodash dependency based on the way it was required (`require` or `import`): 

- Uses `require('lodash')` for CommonJS require calls
- Uses `export * from 'lodash-es'` for ESM import calls

This is especially useful for dual packages that are available as ESM and CommonJS builds simultaneously.
This way you only need one dependency and one simple import call. The rest will be done by the bundler.


## Usage

1. Install `@technically/lodash` to your project
2. Import or require it the usual way and use it like lodash:

   For CommonJS code:

   ```js
   const { isEqual } = require('@technically/lodash');
   
   console.log(isEqual({ a: 1, b: 2 }, { b: 2, a: 1 }));
   ```
   
   For ESM code:

   ```js
   import { isEqual } from '@technically/lodash';
   
   console.log(isEqual({ a: 1, b: 2 }, { b: 2, a: 1 }));
   ```


## Function reference

See official Lodash documentation at: https://lodash.com/.


## Versioning 

Both `lodash` and `lodash-es` are required as `^X.Y.0` using the same semver specifier.

The `@technically/lodash` package version is always based on the `X` and `Y` values as following: `X.Y.{patch}`.


## License

[MIT](./LICENSE)


## Author

Initially implemented by Ivan Voskoboinyk

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