Socket
Book a DemoInstallSign in
Socket

strip-ansi-stream

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-ansi-stream

Strip ANSI escape codes

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
10K
120.86%
Maintainers
2
Weekly downloads
 
Created
Source

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.

  • 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

Keywords

strip

FAQs

Package last updated on 13 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts