Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

tty2http

This is a stream middleware for visualization results from color console output to HTML

Installation

npm --save i tty2http

Example

run from root of module npm i && npm test

convert colorized console output of commend diff tty2html.js test.js --color=always to html

with ability for stream support and show this result online

varfs=require('fs');varspawn=require('child_process').spawn;vartty2html=require('tty2html');varoutput=fs.createWriteStream('stream.html')// or it is can be Express.js Response streamoutput.write('<pre>');//for a \t indentation supportvart2h=tty2html(/* tagName or 'span' as default */);t2h.pipe(output);varchild=spawn('diff',['tty2html.js','test.js','--color=always']);child.stdout.pipe(t2h);child.stderr.pipe(t2h);

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages