find-used-lodash
Use Esprima to find and detect used Lodash packages
Useful for preparing an array to pass to a build task in order to build only used packages.
- Please see Lodash for usable packages.
- Checkout Lodash custom build tool for possible uses.
Important notice Chained Lodash packages are currently not detected.
Install
npm install --save-dev find-used-lodash
Example
General Usage
var findUsedLodash = ; console
Use in a build task (grunt,gulp)...
var findUsedLodash = ; var fileContents = fs; //or get it from file streamvar results = ; var commaResults = results; //then execute lodash command line with **lodash include=commaResults**
Options
@param String jsFileContents - the js file contents as a string@return String array of used Lodash packages
License
MIT @Gilad Peleg