Home

Awesome

strip-ansi-stream

Strip ANSI escape codes

Install

$ npm install strip-ansi-stream

Usage

import stripAnsiStream from 'strip-ansi-stream';

const stream = stripAnsiStream();

stream.on('data', data => {
	console.log(data);
	//=> 'Unicorn'
	//=> 'bar'
})

stream.write('\u001B[4mUnicorn\u001B[0m');
stream.end('\u001B[0;33;49;3;9;4mbar\u001B[0m');

API

stripAnsiStream()

Returns a Transform stream that strips ANSI escape codes.

Related