yarn-audit-html
Version:
Generate a HTML report for Yarn Audit
74 lines (51 loc) • 2.86 kB
Markdown
# yarn-audit-html
[](https://www.npmjs.com/package/yarn-audit-html)
[](https://www.npmjs.com/package/yarn-audit-html)
[](https://snyk.io/test/github/davityavryan/yarn-audit-html)

[](https://github.com/nodejs/release#release-schedule)
[](https://packagephobia.now.sh/result?p=yarn-audit-html)
[](https://codecov.io/gh/davityavryan/yarn-audit-html)
[](https://www.buymeacoffee.com/davityavryan)
[](https://www.buymeacoffee.com/davityavryan)
## Generate a HTML report for Yarn Audit
## Install
```bash
yarn add -D yarn-audit-html
# or globally
yarn global add yarn-audit-html
```
## Usage
To generate a report, run the following:
### Yarn V1
```bash
yarn audit --json | yarn yarn-audit-html
```
### Yarn V2+
```bash
yarn npm audit --json | yarn yarn-audit-html
```
By default, unique vulnerability list will be generated (Grouped by `MODULE_NAME`, `VERSION`, `VULNERABLE_VERSIONS`,
`ADVISORY_CREATED_DATE` and `CWE`) to `yarn-audit.html`. This way, even if same version of package has multiple
vulnerabilities, they will be counted.
If you want to specify the output file, add the `--output` option:
```bash
yarn audit --json | yarn yarn-audit-html --output report.html
```
You can also fully customize the generated report by providing `--template` option followed by your own EJS template:
```bash
yarn audit --json | yarn yarn-audit-html --template ./my-awesome-template.ejs
```
There is also a possibility to change default theme(materia) to any of available in
[Bootswatch](https://bootswatch.com/#:~:text=Cerulean) with `--theme` option followed by theme name: p.s. In future
major release default template will change to dark theme.
```bash
yarn audit --json | yarn yarn-audit-html --theme darkly
```
If you'd like the generator to exit with non-zero exit code when vulnerabilities are found, you can add the
`--fatal-exit-code` option:
```bash
yarn audit --json | yarn yarn-audit-html --fatal-exit-code
```
Inspired by [npm-audit-html](https://github.com/Filiosoft/npm-audit-html) package.
See changelog [here](https://github.com/davityavryan/yarn-audit-html/releases).