Skip to content

Generating dependency_licenses.json

Courtney Brousseau edited this page Aug 5, 2019 · 3 revisions

Code.gov repos should have a dependency_licenses.json referenced in the LICENSE.md to indicate the licenses of all of the project dependencies. This file should be updated periodically as well as whenever a new dependency is added

Generating a dependency_licenses.json file

To generate a dependency_licenses.json, we use the NPM license-checker package.

If the project already has a license script in package.json

Some projects, including code-gov-front-end, have the following script configured in the package.json which will generate a new dependency_licenses.json file

npm run licenses

If the project doesn't already has a license script in package.json

If a project does not already have this script configured you should add it

First install the NPM package:

npm install license-checker

Once it is installed, add this script to the scripts in the package.json:

"licenses": "license-checker --json --relativeLicensePath --out dependency_licenses.json"