https://github.com/pfnet/licensetool
https://github.com/pfnet/licensetool
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pfnet/licensetool
- Owner: pfnet
- License: mit
- Created: 2023-03-27T08:27:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T05:32:47.000Z (over 1 year ago)
- Last Synced: 2025-05-06T05:43:24.665Z (about 1 year ago)
- Language: JavaScript
- Size: 161 KB
- Stars: 3
- Watchers: 64
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**licensetool** is a license tool for web frontend.
# Usage
* Add licensetool to your NPM dependency:
```console
$ npm install --save-dev github:pfnet/licensetool
```
* Output a concatenated license notices of the dependency NPM packages:
```console
$ npx licensetool format --config licensetool.json
$ npx licensetool format --config licensetool.json --output csv # or output as csv
```
When using the --output csv option, the generated CSV file will have the following format:
```csv
licenseName,packageName
MIT License,package-a@1.0.0
MIT License,package-b@1.0.0
```
# `licensetool.json`
* `packages`
Override the properties of the specified packages.
If some properties or a whole package entry is missing from `packages`, those retrieved by [license-checker-rseidelsohn](https://github.com/RSeidelsohn/license-checker-rseidelsohn) and other libraries are used.
* `packages.omit`
Omit this package from the license notices.
```json
{
"packages": {
"somepackage@1.0.0": {
"omit": true
}
}
}
```
* `packages.licenseId`
Specify the SPDX ID.
```json
{
"packages": {
"somepackage@1.0.0": {
"licenseId": "MIT"
}
}
}
```
* `packages.licenseName`
Specify the license name.
```json
{
"packages": {
"somepackage@1.0.0": {
"licenseName": "Modified MIT"
}
}
}
```
* `packages.licenseFile`
Specify the file whose contents is the license text.
If `null` is given, it invalidates the corresponding property retrieved by license-checker-rseidelsohn, which leads to using the default license notice of the resolved SPDX.
```json
{
"packages": {
"somepackage@1.0.0": {
"licenseFile": "path/to/license-notice.txt"
}
}
}
```
```json
{
"packages": {
"somepackage@1.0.0": {
"licenseFile": null
}
}
}
```
* `packages.licenseContent`
Directly specify the content of license notice.
```json
{
"packages": {
"somepackage@1.0.0": {
"licenseContent": "Some Package License\n\nCopyright (C) 2023 John Doe\n\nSome license notice sentences"
}
}
}
```