Coder Social home page Coder Social logo

isabella232 / snyk-to-html Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snyk/snyk-to-html

0.0 0.0 0.0 1.11 MB

export test reports from CLI to html

License: Other

Shell 0.41% JavaScript 68.55% TypeScript 7.66% Handlebars 23.35% Dockerfile 0.03%

snyk-to-html's Introduction

Snyk logo


Snyk JSON to HTML Mapper

The Snyk JSON to HTML Mapper takes the json outputted from snyk test --json and creates a local HTML file displaying the vulnerabilities discovered.

How do I use it?

Install or clone

First, Install the Snyk JSON to HTML Mapper using npm:

npm install snyk-to-html -g

Alternatively, you can clone the repo and run the script locally using:

npm install
npm run build
node ./dist/index.js

Options

Short Long Description
-t --template Template location for generating the html. Defaults to template/test-report.hbs
-i --input Input path from where to read the json. Defaults to stdin
-o --output Output of the resulting HTML. Example: -o snyk.html. Defaults to stdout
-s --summary Generates an HTML with only the summary, instead of the details report. Defaults to details vulnerability report
-d --debug Runs the CLI in debug mode
-a --actionable-remediation Display actionable remediation info if available

When in doubt, use snyk-to-html --help or snyk-to-html -h.

Generate the HTML report

Change directory to your package's root folder, then use of the two ways below to generate the HTML report.

  1. Directly streaming the results to snyk-to-html:

    Run the following line to create a file called results.html:

    snyk test --json | snyk-to-html -o results.html

  2. Using a temporary file:

    Generate JSON data by running snyk test and save the output to a file

    snyk test --json > results.json

    Pass the resulting JSON file to Snyk's JSON to HTML Mapper

    snyk-to-html -i results.json -o results.html

    Note input files should be valid JSON and use UTF-8 encoding.

  3. If you want a simpler version of the report to be shown, you can pass -s or --summary to only display the summary of the report.

    snyk-to-html -i results.json -o results.html -s

  4. Show actionable remediation:

    To display the actions you can take to remedy vulnerabilities, pass -a or --actionable-remediation.

    snyk-to-html -i results.json -o results.html -a

    The report orders remediations (upgrades and patches) by the number and severity of vulnerabilities it fixes. Use this to guide when selecting the order to upgrade and patch packages.

    Note we currently support remediation advice with the following package managers:

    • npm
    • yarn
    • rubygems
    • maven
    • gradle
    • sbt
    • pip

View the HTML report

Simply open your new file (results.html above) in a browser, and rejoice.

License

License: Apache License, Version 2.0

snyk-to-html's People

Contributors

adrukh avatar avishagp avatar darscan avatar deebugger avatar ekbsnyk avatar fauxfaux avatar gitphill avatar huytquach-snyk avatar jackub avatar justshiv avatar kevinwright avatar lili2311 avatar lirantal avatar lwywoo avatar maban avatar maxjeffos avatar michaelaquilina avatar patricia-v avatar pavel-github avatar peterschafer avatar scott-es avatar sebsnyk avatar sfat avatar snyk-bot avatar solal-snyk avatar teodora-sandu avatar thisislawatts avatar tkadlec avatar yairz101 avatar yuliabaron avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.