license-checker
license-checker copied to clipboard
[Bug] Some custom format items don't seem to work properly
I wanted to output the licenses with the "--customPath" option in the following format:
{
"repository":"",
"publisher":"",
"email": "none"
}
However, with the exception of "repository", none of the items worked correctly, only the default values were used. (And YES the fields are filled, if I output them as JSON, they are read and displayed correctly.)
I just used all the items for testing to see which ones work and which don't:
{
"name":"",
"version":"",
"description": "",
"repository":"",
"publisher":"",
"email": "",
"url": "",
"licenses": "",
"licenseFile":"",
"licenseText":"",
"licenseModified": ""
}
The result: In the columns "publisher", "email" and "url" only the default values are used. All others are output as expected.
license-crawler: 18.0.0 OS: Windows 10 Pro 64-bit Node.js: 9.11.1
Was this resolved? I am having the same issue and using the following customFormat.json. The "author" and "contributors" columns are either blank or having "undefined" even there are "author" and "contributors" sections in the related package.json file.
{ "name": "", "version": "", "description": "", "author": "", "licenses": "", "contributors": "", "repository": "", "url": "" }
For anyone who runs into this - remove publisher: ""
(also true for email
and url
) entirely from the customFormat.json and it will be correctly written to the file. Adding it into the customFormat.json with a blank string overwrites it being written.