Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
You-Dont-Need-Lodash-Underscore
List of JavaScript methods which you can use natively + ESLint Plugin
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
For a few years I was opting to use the per-method packages from npm (`npm install lodash.pick`) but they just stopped being updated... https://www.npmjs.com/package/lodash.pick has not been updated in 7 years and is stuck at v4.4.0. I guess I missed the memo on that... and none of the npm packages have been deprecated to reflect the state of things.
Now going onto the lodash package on npm, that's listed as v4.17.21 and hasn't been published in over 2 years: https://www.npmjs.com/package/lodash
Now the lodash package on github, the latest release is listed as v4.0.0 from 2016: https://github.com/lodash/lodash/releases
There have been no commits to the main branch on github in almost 2 years: https://github.com/lodash/lodash/commits/master
I consider lodash to be deprecated at this point, and will always go for a lightweight function pulled from somewhere like SO or No Lodash.
What's more surprising is that Underscore.js[1] has seen more activity recently than Lodash (which was touted as Underscore's successor for years).
[1] https://github.com/jashkenas/underscore
https://github.com/you-dont-need/You-Dont-Need-Lodash-Unders... seems to be a more readable alternative to this website.
https://github.com/you-dont-need/You-Dont-Need-Lodash-Unders... seems to be a more readable alternative to this website.
Tree-shaking doesn't help much when the tree-shaken implementation is so bloated.
Here's the one you referenced, lodash.chunk: https://unpkg.com/lodash.chunk ā 140 lines after removing comments and whitespace.
That's pretty small compared to a lot of the lodash utilities. Try spot-checking a few on unpkg.
I prefer angus's `just` utilities: https://github.com/angus-c/just
Lodash gets so many things wrong Iād rather not see it in most projects. I appreciate a good utility library for JS projects but my go-to choice has to be Ramda[1]. Every function it exports is curried and works great with pipe which enables me to write highly reusable and composable functions in pointfree notation. I have never been as productive with lodash, and I find the functional style easier to read
[1] https://ramdajs.com/
> The API matters, and readability matters.
Exactly, lodash should be part of the language. https://github.com/mlajtos/es1995
We used `cloneDeep` heavily at a previous role, it isn't particulary fast - so be careful if you cloning very big objects (1mb+). There are faster options out there such as https://github.com/davidmarkclements/rfdc
Related posts
- "You-Dont-Need-Lodash-Underscore": ESLint plugin for migration guidance to use newer native JS functions
- Getting Started with Lodash: A Beginner's Guide to JavaScript Utility Functions
- JavaScript Equality Under the Lens: Enhancing React's Dependency Checks
- How to Remove Duplicate Objects from an Array in JavaScript
- Observables and Observers in RxJS