UNPKG

term-to-html

Version:

Stream terminal output with ansi codes into nicely formatted HTML

17 lines (11 loc) 409 B
#!/usr/bin/env node // generates HTML page from streamed STDOUT // $ FORCE_COLOR=2 npx mocha spec.js --reporter spec | ./pass.js // save or redirect the generated HTML file and get yourself a nice page. const arg = require('arg') const args = arg({ '--theme': String, }) const { streams, themes } = require('..') const options = args['--theme'] === 'dark' ? themes.dark : themes.light streams(options)