|
|
|
|
|
by sina
3741 days ago
|
|
I agree that Lodash would be a better choice because it seems like a well maintained project. There could be two counter args, in theory: - if the programmer uses other functions included in Lodash his code will have a single larger point of failure. For example, if Lodash is unpublished (intentionally as in this case, or unintentionally) then the programmer will have a lot more work to redo. - Lodash introduces a lot of code, while the programmer only needs one of its functions to pad a string. |
|
Using a library like lodash makes a lot more sense once you use a module bundler that allows tree shaking (like Rollup or Webpack 2.0) along with the ES6 module syntax. Heck, even if you're just using babel with Browserify or Webpack 1.x, you can use babel-plugin-lodash [0] so it'll update your imports and you only pull in what you need.
[0] https://github.com/lodash/babel-plugin-lodash