lodash-modularized

lodash is a great crossbrowser utility library that keeps you from re-inventing the wheel. Say you need to use the lodash.filter method to filter a collection. Prehaps you are using the filter method like this:

import _ from 'lodash';

const persons = [  
  { name: 'Adam' },
  { name: 'Ben' }
];

export default function searchPerson(name) {  
  return _.filter(persons, { name: name });
};

Nothing wrong with that. But one cool thing about lodash is that every method is modularized and have its own npm-repository.

So, if you just need the _ .filter there is
no need to import whole lodash library. Instead you can import only the _.filter method directly from npm.

npm install lodash.filter --save

import lodashFilter from 'lodash.filter';

const persons = [  
  { name: 'Adam' },
  { name: 'Ben' }
];

export default function searchPerson(name) {  
  return lodashFilter(persons, { name: name });
};

No need to send more JS to the client than what you are using in your app! :)