1.2.0 • Published 9 years ago

find-used-lodash v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

find-used-lodash

Use Esprima to find and detect used Lodash packages

NPM Version NPM Downloads Build Status

Useful for preparing an array to pass to a build task in order to build only used packages.

Important notice Chained Lodash packages are currently not detected.

Install

npm install --save-dev find-used-lodash

Example

General Usage

var findUsedLodash = require('find-used-lodash');

console.log(findUsedLodash('_.each(["a", "b"], doSomething)');
//=> ['each']

Use in a build task (grunt,gulp)...

var findUsedLodash = require('find-used-lodash');

var fileContents = fs.readFileSync('targetFile.js', 'utf8'); //or get it from file stream
var results = findUsedLodash(fileContents);

var commaResults = results.join(',');

//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

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

10 years ago

0.2.0

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago