davglass / license-checker

Check NPM package licenses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error getting license for color.js

luanmuniz opened this issue · comments

The module is getting the wrong license for this repo:
https://github.com/Marak/colors.js

├─ colors@0.6.2
│  ├─ licenses: Custom: http://i.imgur.com/goJdO.png
│  ├─ repository: https://github.com/Marak/colors.js
│  ├─ publisher: Marak Squires
│  ├─ path: /node_modules/colors
│  └─ licenseFile: /node_modules/colors/ReadMe.md

That version is very old and doesn't contain proper license info:
http://registry.npmjs.org/colors/0.6.2

If you use a modern version it reports properly:

└─ colors@1.3.3
   ├─ licenses: MIT
   ├─ repository: https://github.com/Marak/colors.js
   ├─ publisher: Marak Squires
   ├─ path: /home/ubuntu/tmp/node_modules/colors
   └─ licenseFile: /home/ubuntu/tmp/node_modules/colors/LICENSE

https://github.com/Marak/colors.js/tree/b895035f4a50b0bac2139f4a8d11fa9c0a7cbf54
It does have a license file. It's just not named as expected.

https://github.com/davglass/license-checker/blob/master/lib/license-files.js
Here you look for files that start with LICENSE.
In that case, instead of the expected LICENSE-MIT he has an MIT-LICENSE file.

Do you think it's a good idea to include a regex like /\w+\-LICENSE$/?