Reputation: 10166
In my project I have installed underscore.js but I noticed that I need the Lodash's fill
function but installing lodash as well seems a big chunk of dependencies in my project, depedencies that offer similar functionality, thus making it a waste of time migrating from underscore to lodash, or using both libraries.
So how I can have only some specific functionalities from lodash whilst using the underscore.js?
Upvotes: 1
Views: 251
Reputation: 10166
Each lodash function is a separate npm package as well. So you can use install only the specific packages you need via:
npm i --save lodash.^function_name^
Where ^function_name^
is the name of function you need.
Thus you can keep track of the specific lodash methods you need, in order to look on a latter time whether is worthing the time from migrating from underscore to lodash.
Upvotes: 1