Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inthepocket/npm-license-scraper
📜 Dead simple license scraper for npm packages (with zero real dependencies)
https://github.com/inthepocket/npm-license-scraper
cli license npm scraper typescript
Last synced: 2 days ago
JSON representation
📜 Dead simple license scraper for npm packages (with zero real dependencies)
- Host: GitHub
- URL: https://github.com/inthepocket/npm-license-scraper
- Owner: inthepocket
- License: mit
- Created: 2019-11-12T15:01:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T06:43:14.000Z (6 months ago)
- Last Synced: 2024-05-23T04:59:23.187Z (6 months ago)
- Topics: cli, license, npm, scraper, typescript
- Language: TypeScript
- Size: 864 KB
- Stars: 7
- Watchers: 23
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 📜 Dead simple license scraper with zero dependencies
[![npm](https://img.shields.io/npm/v/@inthepocket/npm-license-scraper)](https://www.npmjs.com/package/@inthepocket/npm-license-scraper)
![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)## Introduction
`npm-license-scraper` will scan your `package.json` and `node_modules` to generate a JSON file including the licenses of all open source packages that are being used.
## Usage
```shell
$ npm i -D @inthepocket/npm-license-scraper# Via npx
$ npx npm-license-scraper# Directly
$ node node_modules/.bin/npm-license-scraper
```### Options
- `--export [filename]`: Export to a JSON file. (default `./licenses.json`)
- `--includeDev`: Include dev dependencies in output (default `false`)
- `--exclude [package|package,package,package]`: Ignore certain packages from the check (e.g submodules, monorepo or private packages)## Output format
The exported JSON file has the following format:
```ts
type JSON = Array<{
name: string;
version: string;
license: string;
url: string;
isValid: boolean;
}>;
```Example:
```json
[
{
"package": "react",
"version": "18.0.0",
"license": "MIT",
"url": "https://reactjs.org/",
"isValid": true
},
{
"package": "react-native",
"version": "0.69.3",
"license": "MIT",
"url": "https://npmjs.com/package/react-native",
"isValid": true
}
]
```