npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

strip-ansi-stream

2.0.1

@sindresorhus

npmHomeRepoSnykSocket
Downloads:1121
$ npm install strip-ansi-stream
DailyWeeklyMonthlyYearly

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

  • strip-ansi - Non-streaming version of this module
  • has-ansi - Check if a string has ANSI escape codes
  • ansi-regex - Regular expression for matching ANSI escape codes
  • chalk - Terminal string styling done right