mwittig / npm-license-crawler

Analyzes license information for multiple node.js modules (package.json files) as part of your software project.
BSD 3-Clause "New" or "Revised" License
234 stars 45 forks source link

Pull license value from license file #22

Open jamiemjennings opened 6 years ago

jamiemjennings commented 6 years ago

npm allows for the license to be specified in an external file: https://docs.npmjs.com/files/package.json#license

Example (package.json):

{ "license" : "SEE LICENSE IN <filename>" }

Currently npm-license-crawler will return:

├─ foo-module@1.2.3
│  ├─ licenses: SEE LICENSE IN LICENSE.txt

It would be preferable for it to return the contents of LICENSE.txt as the licenses output.

mwittig commented 5 years ago

Dumping the file contents to the licenses output may break the output.

I need to check to what extent --relativeLicensePath covers the "SEE LICENSE IN" case. It should work for at least if the filename is LICENSE or LICENSE.txt