Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme #35

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# pnpm-license-exporter
# pnpm-license-exporter

![License](https://img.shields.io/npm/l/@luco-inc/pnpm-license-exporter?style=for-the-badge)
![Version](https://img.shields.io/npm/v/@luco-inc/pnpm-license-exporter?color=blue&label=Version&logo=npm&style=for-the-badge)

Dependencies license exporter for projects using pnpm.

Internally using the `pnpm licenses list` command to get the licenses of the dependencies.


## Requirements

- Node.js 20.0.0 or higher (tested on 20.12.2, experimental support for 18.3.0 or higher)
- Internally using [`parseArgs`](https://nodejs.org/api/util.html#utilparseargsconfig) which is available since Node.js 18.3.0
- pnpm 6.0.0 or higher (tested on 6.14.4)
- CAN NOT use yarn and npm

## Usage

```bash
pnpm install -D @luco-inc/pnpm-license-exporter

pnpm-license-exporter [options]
```

or

```bash
pnpm dlx @luco-inc/pnpm-license-exporter [options]
```


## CLI Usage
Export only directly & production dependencies: `pnpm-license-exporter`
Export all production dependencies: `pnpm-license-exporter --recursive` <-- Recommended
Export all dependencies: `pnpm-license-exporter --recursive --dev`

## Options
| Arg | Description | Type | Default |
|-----------------|----------------------------------|----------------|-----------------|
| -o, --output | Output folder for the exports. | [string] | ./licenses.json |
| -p, --pretty | Prettify the json output. | flag/[boolean] | false |
| -r, --recursive | Include all subDependencies | flag/[boolean] | false |
| -d, --dev | Include dev dependencies. | flag/[boolean] | false |
| --no-prod | Exclude production dependencies. | flag/[boolean] | false |
| --no-optional | Exclude optional dependencies. | flag/[boolean] | false |

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@
"publishConfig": {
"access": "public"
},
"packageManager": "[email protected].6+sha256.01c01eeb990e379b31ef19c03e9d06a14afa5250b82e81303f88721c99ff2e6f"
"packageManager": "[email protected].7+sha256.50783dd0fa303852de2dd1557cd4b9f07cb5b018154a6e76d0f40635d6cee019"
}