I am getting rid of lodash, so some stuff I am redoing in es6 and other like this one I would like to keep but just this one function.
I see there is this npm https://www.npmjs.com/package/lodash.minby but im not sure if i install this it will only install this, or the whole library, can anyone please confirm?
Thanks.
CodePudding user response:
From the documentation:
The lodash method
_.minBy
exported as a Node.js module.
So, yes, it just installs this specific function from lodash
CodePudding user response:
Yes, if you install lodash.minby
, at the time of this writing, you will get version 4.6.0 which contains a package.json
file, a README.md
file, a LICENSE
file, and an index.js
file. It has no other dependencies, so that is all you will get. The index.js
file is over 2000 lines long, but that's what it takes apparently to implement the functionality.
In contrast, at the time of this writing, npm install lodash
will give you version 4.17.21 which contains over 44000 lines of JavaScript spread out across many files. So that's about 22 times as large.