1 | # yarn-audit-html
|
2 |
|
3 | [![](https://img.shields.io/david/davityavryan/yarn-audit-html.svg?style=flat-square)](https://david-dm.org/davityavryan/yarn-audit-html/master)
|
4 | [![](https://img.shields.io/david/dev/davityavryan/yarn-audit-html.svg?style=flat-square)](https://david-dm.org/davityavryan/yarn-audit-html/master?type=dev)
|
5 | [![](https://img.shields.io/david/peer/davityavryan/yarn-audit-html.svg?style=flat-square)](https://david-dm.org/davityavryan/yarn-audit-html/master?type=peer)
|
6 | ![](https://img.shields.io/github/last-commit/davityavryan/yarn-audit-html.svg?style=flat-square)
|
7 | [![](https://img.shields.io/snyk/vulnerabilities/npm/yarn-audit-html.svg?style=flat-square)](https://snyk.io/test/npm/yarn-audit-html)
|
8 | [![](https://img.shields.io/lgtm/alerts/g/davityavryan/yarn-audit-html.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/davityavryan/yarn-audit-html/alerts/)
|
9 | [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/davityavryan/yarn-audit-html.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/davityavryan/yarn-audit-html/context:javascript)
|
10 | [![](https://flat.badgen.net/packagephobia/install/yarn-audit-html)](https://packagephobia.now.sh/result?p=yarn-audit-html)
|
11 | [![Gitter](https://badges.gitter.im/yarn-audit-html/community.svg)](https://gitter.im/yarn-audit-html/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
12 |
|
13 | [![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/davityavryan)
|
14 |
|
15 | ## Generate a HTML report for Yarn Audit
|
16 |
|
17 | ## Install
|
18 |
|
19 | ```bash
|
20 | yarn global add yarn-audit-html
|
21 | ```
|
22 |
|
23 | ## Usage
|
24 |
|
25 | To generate a report, run the following:
|
26 |
|
27 | ```bash
|
28 | yarn audit --json | yarn-audit-html
|
29 | ```
|
30 |
|
31 | By default, unique vulnerability list will be generated (Grouped by `MODULE_NAME`, `VERSION` and `CWE`) to
|
32 | `yarn-audit.html`
|
33 |
|
34 | If you want to specify the output file, add the `--output` option:
|
35 |
|
36 | ```bash
|
37 | yarn audit --json | yarn-audit-html --output report.html
|
38 | ```
|
39 |
|
40 | You can also fully customize the generated report by providing `--template` option followed by your own EJS template:
|
41 |
|
42 | ```bash
|
43 | yarn audit --json | yarn-audit-html --template ./my-awesome-template.ejs
|
44 | ```
|
45 |
|
46 | If you'd like the generator to exit with non-zero exit code when vulnerabilities are found, you can add the
|
47 | `--fatal-exit-code` option:
|
48 |
|
49 | ```bash
|
50 | yarn audit --json | yarn-audit-html --fatal-exit-code
|
51 | ```
|
52 |
|
53 | Inspired by [npm-audit-html](https://github.com/Filiosoft/npm-audit-html) package.
|
54 |
|
55 | ## License
|
56 |
|
57 | [MIT](LICENSE.md)
|