https://github.com/tobysmith568/license-sorter
An npm CLI which sorts the JSON output from the library license-checker by the license type
https://github.com/tobysmith568/license-sorter
checker cli licence license nodejs npm oss sorter typescript
Last synced: 7 months ago
JSON representation
An npm CLI which sorts the JSON output from the library license-checker by the license type
- Host: GitHub
- URL: https://github.com/tobysmith568/license-sorter
- Owner: tobysmith568
- License: isc
- Created: 2020-04-06T11:28:13.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T09:12:16.000Z (about 2 years ago)
- Last Synced: 2025-02-16T06:16:59.379Z (8 months ago)
- Topics: checker, cli, licence, license, nodejs, npm, oss, sorter, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/license-sorter
- Size: 1.02 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Licence-Sorter [](https://dev.azure.com/tobysmith568/License-Sorter/_build/latest?definitionId=14&branchName=master)
This CLI takes a JSON file outputted from the NPM library [license-checker](https://www.npmjs.com/package/license-checker) and sorts it so that the results are grouped by their licenses.
### Eg.![]()
## Installation and Usage (CLI)
```
$ npm install license-sorter -g$ license-sorter --input licenses.json --output licenses-sorted.json
```
- Input: The file to be converted
- Output: The file to be createdIf either flag is omitted the CLI will prompt you for the inputs.
If you don't supply an input file, and the CLI is able to detect a package.json file, the it will allow you to run the command using dependencies it detects in the local project.
## Installation and Usage (Programmatic use)
```
$ npm install license-sorter
```
```js
const licenseSorter = require("license-sorter");licenseSorter.convertFile("licenses.json", "licenses-sorted.json")
.then(() => {})
.catch(() => {});
```
```ts
import * as licenseSorter from "license-sorter";await licenseSorter.convertFile("licenses.json", "licenses-sorted.json");
```This library is in no way affiliated with [license-checker](https://www.npmjs.com/package/license-checker).