Giter Club home page Giter Club logo

license-report's Introduction

ANNOUCEMENT: repository changing ownership

On the 16th of March 2024 this repository will change ownership and move to the personal account of one of it's maintainers, Yaniv Kessler

Ownership change will also occur on the npm registry to Yaniv Kessler

NPM License Report Tool

Version License: MIT

Generate a license report for the projects dependencies.

Installation

npm install -g license-report

Functionality

license-report gets the dependencies of a program or package from its package.json file and for each dependency adds the installed version, the license type and the author from the corresponding package.json file in the node_modules directory and the latest available version and other data from the (npm) registry where this package was installed from.

Prerequisites

  1. The dependencies of the project under inspection must be installed so that the node_modules directory exists in the path of the package.json file.
  2. The registry defined in the registry configuration setting must be accessible (default: 'https://registry.npmjs.org/').

Configuration

Run license-report without options:

By default, license-report outputs all licenses from dependencies, devDependencies, optionalDependencies and peerDependencies.

cd your/project/
license-report

Select dependencies:

To specify one or some dependency types, use configuration options, e.g.

license-report --only=dev
license-report --only=prod
license-report --only=prod,opt,peer

The 'only' option is a comma separated list of the dependencies to use.
Possible values are:

value segment of package.json
prod dependencies
dev devDependencies
opt optionalDependencies
peer peerDependencies

Explicit package.json:

To define the package.json to inspect, use the 'package' option.

license-report --package=/path/to/package.json

Customize a field's label:

The configurable labels are used as column headers in table / csv / html output. For html output the labels of all fields in the output must be unique.

license-report --department.label=division

Customize a fields default value:

Only applicable for the fields in the list later in this document and for "custom" fields (look for "Fields with data set in the configuration of license-report")

license-report --department.value=ninjaSquad

Use another registry:

To define the registry, the remote data for packages are fetched from, use the 'registry' option.

license-report --registry=https://myregistry.com/

Registry with authorization:

To use a npm registry that requires authorization, the option npmTokenEnvVar must contain the name of an environment variable that contains the required npm authorization token (the default name is 'NPM_TOKEN'). An example:

# if the name of the environment variable containing the bearer token for npm authorization is 'NPM_TOKEN'
license-report --registry=https://myregistry.com/ --npmTokenEnvVar=NPM_TOKEN

The name of this environment variable (in the example: 'npm_token') should not be added as an option to the license-report config file, as this implies a severe security risk, when this file is checked in into a git repository. A warning is emitted if such an option is found in the config file.

Generate different outputs:

license-report --output=table
license-report --output=json
license-report --output=csv
license-report --output=html
license-report --output=markdown

# replace default ',' separator with something else
license-report --output=csv --delimiter="|" 

# output csv headers (fields) on first row
license-report --output=csv --csvHeaders

# use custom stylesheet for html output
license-report --output=html --html.cssFile=/a/b/c.css

# see the output immediately in your browser, use hcat
license-report --output=html | hcat

When using the 'hcat' package to open the result in a browser, this package must be globally installed with npm i -g hcat.

Select fields for output:

If only a few fields are required in the output, the easiest way of selecting the fields is via --fields command line arguments.

# set options with command line arguments
license-report --output=csv --fields=name --fields=installedVersion

If more fields are needed, the best way is to use a custom config file, that contains a fields array.

# set options with command line option for custom (partial) config file
license-report --output=csv --config license-report-config.json
# example of config file for backward compatible output:
{
  "fields": [
    "department",
    "relatedTo",
    "name",
    "licensePeriod",
    "material",
    "licenseType",
    "link",
    "comment",
    "installedVersion",
    "author"
  ]
}

Besides the 'build-in' fields ("department", "name", "installedVersion", "author" "comment", "licensePeriod", "licenseType", "link", "material", "relatedTo"), any field allowed in a package.json can be used in the fields array (as "custom" field).

When using "custom" field, an element named like the "custom" field with 2 properties must be added: "value" - the default value for this field - and "label - the "heading" for generated columns. Here is an example for adding the 'homepage' field:

  "fields": [
    "name",
    "installedVersion",
    "homepage"
  ],
  "homepage": {
    "value": 'n/a',
    "label": 'Homepage'
  }

Exclude packages:

With the 'exclude' option, single packages can be excluded from the output.

license-report --exclude=async --exclude=rc

Using the 'excludeRegex' option, packages can be excluded from the output using a regular expression.

license-report --excludeRegex=@mycompany\/.*

Format output

Markdown Options

If you want to change the default markdown table look and feel, e.g. center-align the text, you have to use a custom config file (--config=license-report-config.json) and in the config file use the tablemarkConfig property.

Example config for markdown table with center-aligned content:

"output": "markdown",
"fields": [
    "department",
    "relatedTo",
    "name",
    "licensePeriod",
    "material",
    "licenseType",
    "link",
    "comment",
    "installedVersion",
    "author"
  ],
"tablemarkOptions": {
  "columns": [
    { "name" : "department", "align": "center" },
    { "name" : "relatedTo", "align": "center" },
    { "name" : "name", "align": "center" },
    { "name" : "licensePeriod", "align": "center" },
    { "name" : "material", "align": "center" },
    { "name" : "licenseType", "align": "center" },
    { "name" : "link", "align": "center" },
    { "name" : "comment", "align": "center" },
    { "name" : "installedVersion", "align": "center" },
    { "name" : "author", "align": "center" }
  ]
}

For an explanation of all available options see https://github.com/haltcase/tablemark

Screenshots

screenshot screenshot1 screenshot1

"Build-in" fields

Fields with data of the installed packages:

fieldname column title data source
name name name of the package
licenseType license type type of the license of the package (e.g. MIT)
link link link to the repository of the package
installedFrom installed from the download source for the installed package (optional field)
remoteVersion remote version latest available version of the package in the registry following defined semver range (can be different from the installed version)
installedVersion installed version installed version of the package (can be different from the remote version)
definedVersion defined version version of the package as defined in the (dev-) dependencies entry (can start with a semver range character)
latestRemoteVersion latest remote version latest version of the package available in the registry (optional field)
latestRemoteModified latest remote modified last modification date of the package in the registry (optional field)
comment comment deprecated (replaced by field 'remoteVersion'); will be removed in a future version
author author author of the package

ย 
Fields with data set in the configuration of license-report:

fieldname column title set value
department department --department.value=kessler
relatedTo related to --relatedTo.value=stuff
licensePeriod license period --licensePeriod.value=perpetual
material material / not material --material.value=material

More configuration options

See lib/config.js for more details e.g. on customizing the generated html data.

license-report uses the 'rc' package for handling configuration. So it is possible to add options to the command line, use a custom (partial) configuration file or even a default configuration file in a project.

A default project configuration file must be placed in the project root path and be named .license-reportrc. The file format is 'json'. An example looks like this:

{
  "output": "table",
  "fields": [
    "name",
    "licenseType",
    "installedVersion",
    "definedVersion",
    "remoteVersion",
    "latestRemoteVersion",
    "latestRemoteModified",
    "author"
  ]
}

To find out what configuration options are available see the /lib/config.js file in the project source.

For more 'rc' configuration details see the rc documentation.

Debug report generation

By setting the debug environment variable as follows, detailed log information is generated during the report generation. For details see the documentation of the debug package on npm.

export DEBUG=license-report*

Changelog

For list of changes and bugfixes, see CHANGELOG.md.

Hints

license-report actively supports all 'supported release lines' of node.js (currently 18.x, 20.x, 21-x). As got now requires at least node v20.x (see got releases), we will stay with [email protected] until node v18 is no longer supports.

Contributing

The CHANGELOG.md is generated with standard-changelog (using the command npm run release).

To make this possible the commit messages must follow the conventional commits specification.

<type>: <description>

<optional body>

The following is the list of supported types:

  • build: changes that affect build components like build tool, ci pipeline, dependencies, project version, etc...
  • chore: changes that aren't user-facing (e.g. merging branches).
  • docs: changes that affect the documentation.
  • feat: changes that introduce a new feature.
  • fix: changes that patch a bug.
  • perf: changes which improve performance.
  • refactor: changes which neither fix a bug nor add a feature.
  • revert: changes that revert a previous commit.
  • style: changes that don't affect code logic, such as white-spaces, formatting, missing semi-colons.
  • test: changes that add missing tests or correct existing tests.

To ensure the syntax of commit messages commitlint is used, triggered by husky. This feature must be activated with npm run activate-commitlint once for every local clone of license-report.

ironSource logo

license-report's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

license-report's Issues

HTML output

It would be great if tool would support HTML output.

Regards, Tomaลพ

Can't install 6.3.0

Hello ๐Ÿ™‚

Looking to get access to the markdown formatter, but the latest version yarn can resolve is 6.2.0

Getting error when using license-report

Hi Im using your plugin to generate licences in my project but when
I run command "license-report --only=prod --output=json"
Im getting following errors:

Error: invalid statusCode 404
    at Request._callback (/work/Projects/ELS/node_modules/license-report/lib/getPackageJson.js:43:29)
    at Request.self.callback (/work/Projects/ELS/node_modules/license-report/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/work/Projects/ELS/node_modules/license-report/node_modules/request/request.js:1157:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/work/Projects/ELS/node_modules/license-report/node_modules/request/request.js:1079:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)

dependency "got" 11.8.5 has moderate severity vulnerability

Hej,
dependency "got" in version 11.8.5 has moderate severity vulnerability:

got  <11.8.5
Severity: moderate
Got allows a redirect to a UNIX socket - https://github.com/advisories/GHSA-pfrx-2q88-qq97
fix available via `npm audit fix`
node_modules/got

1 moderate severity vulnerability

thanks! Markus :)

TypeError: Cannot read property 'email' of undefined

Greetings!

For package, https://www.npmjs.com/package/react-hook-form library throws an error if it's specified in package.json

Steps to reproduce:

Save to package.json

{
  "name": "react_hook_bug",
  "version": "1.0.0",
  "description": "test",
  "main": "index.js",
  "scripts": {
    "test": "exit 0"
  },
  "keywords": [
    "keywords"
  ],
  "author": "author",
  "license": "ISC",
  "dependencies": {
    "react-hook-form": "^7.27.0"
  }
}

license-report command with raise exception like below

/usr/local/lib/node_modules/license-report/lib/getPackageReportData.js:57
			if (author.email) { author = author + ' ' + author.email; }
			           ^

TypeError: Cannot read property 'email' of undefined
    at /usr/local/lib/node_modules/license-report/lib/getPackageReportData.js:57:15
    at /usr/local/lib/node_modules/license-report/lib/getPackageJson.js:22:3
    at Stubborn.p._onTaskExecuted (/usr/local/lib/node_modules/license-report/node_modules/stubborn/lib/Stubborn.js:71:18)
    at wrapper (/usr/local/lib/node_modules/license-report/node_modules/lodash/lodash.js:4991:19)
    at /usr/local/lib/node_modules/license-report/node_modules/lodash/lodash.js:10118:25
    at Request._callback (/usr/local/lib/node_modules/license-report/lib/getPackageJson.js:55:11)
    at Request.self.callback (/usr/local/lib/node_modules/license-report/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.<anonymous> (/usr/local/lib/node_modules/license-report/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:198:13)

Version: [email protected]

Latest version doesn't mach remote version

Hallo.

I found that the output returns always the same versions:

image

These two props return the correct values:

json['dist-tags']['latest']
json['dist-tags']['next']

example:
image

packageEntry.version 7.2.12
localVersionSemverRange 7.2.12

version 7.2.12

latest version 14.1.0
next version 14.1.0-rc.0

but script return:

{
  name: '@angular/core',
  author: 'angular',
  licenseType: 'MIT',
  link: 'git+https://github.com/angular/angular.git',
  definedVersion: '7.2.12',
  installedVersion: '7.2.12',
  remoteVersion: '7.2.12',
  comment: '7.2.12'
}

Use default config file

it will be great to use default config file.

example:
image

And then anyone can change it, e.g.:

{
  "fields": [
    "name",
    "licenseType",
    "author",
    "link",
    "installedVersion",
  ],
  "output": "html",
  "only": "prod,dev",
  "registry": "http://example.com"
}

currently I need to specify config file manually:

    "build:license-report": "license-report --config=.license-report-config  > ./src/dependencies.html"

NPM_TOKEN not picked up for private dependencies

Getting some errors when repo has private packages

http request to npm for package "@****/*****" failed, retrying again soon...
Error: invalid statusCode 404

The NPM_TOKEN env variable is set and valid

PNPM support

Right now, only npm and yarn lock files are supported

Fails with versions like "nightly" and "latest"

license-report just tells me skipping package@nightly (invalid semversion) for any version that isn't parsable as a semver.

But why does it need the version anyway?

npm accepts these "versions", so it seems like license-report should as well.

Thank you!

Recursion?

It would be neat if packages were checked recursively (with dependencies of dependencies acting as if --only prod was enabled because their devDependencies are irrelevant).

Allow specifying running flags/args/params in JSON-config file

license-report supports multiple flags/args/params, e.g. --only, --package, --output etc.

It would be great to consolidate all such configurations in one single JSON (e.g. license-report-config.json) and apply it with --config.

Currently, part of configurations can be done in JSON and part as flags/args/params only.
I would like to have all configurations in one single place.

installed version shows value from package.json not actually installed version

The field installedVersion of license-report takes the values from (dev-) dependencies and removes the range character, if any exist.

That is ok, if there is no range defined, because npm then installs exactly the version given.

But if there is a range character, then npm installs the greatest version that correspondents to the range.
So using the current version of license-report, it defines debug@^4.2.0 and therefore installs [email protected] (on 2021-04-25).
The installed version is documented in the package-lock.json.

So probably we better should get the installed version from package-lock.json.

CSV format column names line

Use configured labels and dump Column names as a first row in CSV output. This could be optional/parametrized behavior.

Example:

Organization,Module,Version,License,License URL,Location URL
 ,jest,23.6.0,MIT, ,git+https://github.com/facebook/jest.git
 ,license-report,2.1.3,MIT, ,git+https://github.com/ironSource/license-report.git

Custom Registry Cafile

Hi,

thanks for your amazing work.

I saw that your license-report config serves the ability to override the npm registry.
Is there also the ability to add a cafile? Otherwise if you are behind a proxy, the custom registry is not practicable.

http request to npm for package "sharp" failed, retrying again soon...
Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
    at TLSSocket.emit (events.js:314:20)
    at TLSSocket._finishInit (_tls_wrap.js:932:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

Best,
Stefan

Getting 404

I get this error when I run HTTPError: Response code 404 (Not Found)

Cannot read property 'version' of undefined

  • npm: 6.14.8
  • node: v14.15.1

Description

After updating from 4.x to 5.0.1, the following crash happens when trying to generate the licenses. I also ran a clean install of all dependencies, with the same effect.

@flaming-codes โžœ /workspaces/flaming.codes/app (master โœ—) $ npm run dep:gen

> [email protected] dep:gen /workspaces/flaming.codes/app
> license-report --only=prod --output=json > licenses.json

TypeError: Cannot read property 'version' of undefined
    at getInstalledVersions (/workspaces/flaming.codes/app/node_modules/license-report/lib/getInstalledVersions.js:19:75)
    at /workspaces/flaming.codes/app/node_modules/license-report/index.js:77:27
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dep:gen: `license-report --only=prod --output=json > licenses.json`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] dep:gen script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/codespace/.npm/_logs/2022-03-07T21_50_48_740Z-debug.log

Specifically, this code line the lib causes the error.

Solution

I think the logic in the referenced code line has a bug.

if ((packageLockDependency !== undefined) || (packageLockDependency.version !== undefined)) {
 ...
}

packageLockDependency in the second check will always be undefined, as the first check fails if it's actually defined, therefore leading to the execution of the second one.

A simple fix might be to update the logic.

if (packageLockDependency && packageLockDependency.version !== undefined) {
 ...
}

or even simpler

if (packageLockDependency?.version !== undefined) {
 ...
}

Notes

I could work on the fix (fix itself is small, but adding tests) if desired.

Version number from package.json missing in output

The output of license-report lists the most recent version number from the repository.

From my point of view the report would be even more valuable, if it would also contain the version number from the package.json.

The information is available in getPackageReportData.js, so that wouldn't be too difficult.
How about 'installedVersion' as field name?

Inconsistent behaviour under different output types

I am trying to repurpose the "relatedTo" column to display the current version of my application. But I am getting inconsistent behavious when the output is "html" and "table".
When I try to output the result as a table by running the following command

license-report --output=table --package=package.json --relatedTo.label="Version" --relatedTo.value=1.0.3

I get the expected result as shown in the image
output-table

But the story is not the same try to output as html.
Using the following command

license-report --output=html --package=package.json --relatedTo.label="Version" --relatedTo.value=1.0.3 > dependencies.html

The column label dosent get updated as shown in the image below
output-html

Which one of this is the expected behaviour ?

PS: In your README.md, there is a section on "customize a default value (only applicable for some fields)". Could you also list out which are those applicable fields.

Registry prop without latest slash throw an error

if I use --registry=my.registryserver.com/some/path, then I have an error because the result link for bootstrap will be so:
my.registryserver.com/some/pathbootstrap

but should be my.registryserver.com/some/path/bootstrap

it will be better to add an additional check for the last slash, and if not exists, then add it manually.

Getting an error

Just running licence-report in the project folder

/usr/local/lib/node_modules/license-report/lib/extractLink.js:14
                if (value.substr(0, 'http'.length) === 'http') {
                          ^

TypeError: value.substr is not a function
    at /usr/local/lib/node_modules/license-report/lib/extractLink.js:14:13
    at module.exports (/usr/local/lib/node_modules/license-report/node_modules/visit-values/index.js:20:3)
    at module.exports (/usr/local/lib/node_modules/license-report/node_modules/visit-values/index.js:16:4)
    at module.exports (/usr/local/lib/node_modules/license-report/lib/extractLink.js:13:2)
    at /usr/local/lib/node_modules/license-report/lib/getPackageReportData.js:66:11
    at /usr/local/lib/node_modules/license-report/lib/getPackageJson.js:23:3
    at Stubborn.p._onTaskExecuted (/usr/local/lib/node_modules/license-report/node_modules/stubborn/lib/Stubborn.js:71:18)
    at wrapper (/usr/local/lib/node_modules/license-report/node_modules/lodash/lodash.js:4935:19)
    at /usr/local/lib/node_modules/license-report/node_modules/lodash/lodash.js:10052:25
    at Request._callback (/usr/local/lib/node_modules/license-report/lib/getPackageJson.js:56:11)

Monorepo support

I am trying to leverage this tool to generate the license lists for all the packages in a monorepo and have run into a few issues:

  1. if I run from the root of the repo, then I only see the dependencies in the root package.json - that's kind of expected
  2. if I run from the package's folder, then the license is missing for any hoisted dependency

I think monorepo support could be added easily by either:

  1. --monorepo option: the tool would scan the sub-directories for package.json files and resolve the locally installed package to either the value in it's nearest node_modules folder UP TO the root directory
  2. --add-node-modules X option: the tool would scan these additional locations for module metadata

Wrong output type inside repo with zero dependencies

After a command inside repo with zero dependencies you get a text "nothing to do" despite the type into the command such as "license-report --output=json" or any other. The type should be predictable and based onto type in command

List all fields from config.json and their datasource in README.md

Today you can find out about the available fields only by looking into the source code.

Wouldn't it be easier, if the README.md listed all the field names?
Additionally this would be a fine place to describe that the fields 'department', 'relatedTo', 'licensePeriod' and 'material' must be set by the command line and that the field 'comment' contains the most recent version number for this package in the repository.

Response Code 404 (Not Found) with local dependencies

Hello all,

NO PROBLEM WITH NODE, SEE UPDATE BELOW

I have recently installed Node version 14.19.2 in my WSL. Since upgrading to this version, I can no longer create a licence report because the command returns a 404 Not Found Error.

In another WSL instance with Node version 14.18.2, the creation of the report works perfectly. I have attached 2 screenshots with debug logging.

Can you please take a look at the problem? Downgrading my WSL instance to a version <14.19 is unfortunately not an option.

Many thanks and kind regards
Johannes

Output on Node 14.19.2:
license_14 19 2

Output on Node 14.18.2:
license_14 18 2

UPDATE

Issue has nothing to do with Node.

I found the problem. I have a local dependency in my package.json file:
... "local-dep": "file:ext/local-dep-2.13.6.tgz", ...

When I remove this dependency the generation of the license report works perfectly.

I also tried it with a colleague in his WSL, who was still using an older version of licence-report. The generation worked perfectly for him.

The output of the generated license-report with the local dependency was like this - which was OK for us:
local-dep,n/a,n/a,n/a

After updating to the current version of license-report, he also got the "404 Not Found" error.

The problem has nothing to do with the Node version. The problem seems to be that license-report in the new version can no longer handle local dependencies. Unfortunately, I had installed different versions of license-report on my WSL instances and therefore immediately suspected that it was due to the Node version.

Markdown Output

It would be useful if Markdown was added to the available outputs.
The default table is already great, but if it were possible to have a Markdown table then the results could be rendered nicely without any post processing.

Add "output" file into config

it will be great to have an additional output-path property for exporting data directly into this file and not use manualy pipes in the console outputs to concatenate results.

example:
image

And then anyone can change it, e.g.:

{
  "fields": [
     ...
  ],
  "output": "html",
  "outputPath": "./src/dependencies.html"
}

currently, I need to specify the config file manually:

    "build:license-report": "license-report --config=.license-report-config  > ./src/dependencies.html"

but with this config I will just call

    "build:license-report": "license-report --config=.license-report-config"

and license-report should create a file

TypeError: Cannot read property 'email' of undefined; author feature not fully working

Hi,

Thank you for this tool!

When running it on some projects, I have this error:

<my-project>/node_modules/license-report/lib/getPackageReportData.js:57
                        if (author.email) { author = author + ' ' + author.email; }
                                   ^

TypeError: Cannot read property 'email' of undefined
    at <my-project>/node_modules/license-report/lib/getPackageReportData.js:57:15
    at <my-project>/node_modules/license-report/lib/getPackageJson.js:22:3
    at Stubborn.p._onTaskExecuted (<my-project>/node_modules/stubborn/lib/Stubborn.js:71:18)
    at wrapper (<my-project>/node_modules/lodash/lodash.js:4949:19)
    at <my-project>/node_modules/lodash/lodash.js:10076:25
    at Request._callback (<my-project>/node_modules/license-report/lib/getPackageJson.js:55:11)
    at Request.self.callback (<my-project>/node_modules/request/request.js:185:22)
    at Request.emit (events.js:314:20)
    at Request.<anonymous> (<my-project>/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:314:20)

It appears that some projects have an author field like this in their package.json:

"author": "<some-email>",

(e.g. react-hook-form: https://github.com/react-hook-form/react-hook-form/blob/v7.0.4/package.json#L64)

which translates likes this in the registry:

{ "email": "some-email" }

The failing line has been introduced by #29

https://github.com/ironSource/license-report/blob/a48a7e78dfc63144f3e9d951594a21fd1f6ec480/lib/getPackageReportData.js#L54-L59

So in case the dependency specifies only an email, but no name, this creates the exception.

However, this also shows that even in case the author object does have a name field, the next 2 lines will be useless as we modify the author variable to be now the name string, i.e. it is no longer the author object.

We can indeed see in the report (when it works) that there is never an email nor a URL appended to the author name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.