iandotkelly / nlf

Node License Finder
MIT License
153 stars 41 forks source link

Add licenseFileNamePartsToFind option #45

Open ikkala opened 7 years ago

ikkala commented 7 years ago

Generalized the support for arbitrary license file names because of the need for file name "copying". This merge could solve also issue #43.

About implementation: To avoid callback hell when looping through given file names refactored the code ( b6f6c06) to use generator functions in createModule function. Next, added licenseFileNamePartsToFind option that must be array of file names (or regexps). To support newish "license" file variations #44 array items can also contain alternative license collection name. So, the default for this parameter is [['li@(c|s)en@(c|s)e', 'license'], 'readme'].

Unfortunately, to support generator functions in tests, had to upgrade gulp-mocha and therefore the gulp-coveralls now fails. The Coveralls integration plugin seems to be quite old and there's no more new version available.

ikkala commented 7 years ago

It's actually gulp-coverage that fails silently because of reasons explained here https://github.com/sindresorhus/gulp-mocha/issues/159 and then gulp-coveralls has nothing to send.

iandotkelly commented 7 years ago

I've made a significant change to nlf to support npm3 which is probably going to conflict with this. Now that it doesn't support node < 4 I'm planning to significantly rewrite this to be cleaner and more es6y.

ikkala commented 7 years ago

Ok, let me know when your es6 branch is in good enough shape so that I can redo the idea of this pull request to it also. Or perhaps then when it merges the main.