Skip to main content

License

License Screenshot

Introduction

The license option displays all listed licenses in a particular Node.js package or a local project, e.g.:

pkga license --package react

This command will list the licenses for the latest version of react.

Options

ArgumentDescription
--packagename and version of package e.g. react@17.0.2, will default to latest version if no version is provided
--folderpath to a local package.json on the filesystem
--typeWhich type of dependencies to traverse: dependencies or devDependencies. Defaults to dependencies.
--allowDefine an allowlist that the licenses must fulfill. Can be specified multiple times.
--groupedWill group licenses by their name.

Example Usages

List licenses for a package

pkga license --package react

Define an allowlist with multiple licenses

pkga license --package react --allow MIT --allow ISC

Group licenses

pkga license --package react --grouped

List licenses for a local project's devDependencies

pkga license --folder ./path/to/project --type devDependencies