Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stripcolorcodes

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stripcolorcodes

Remove color codes (special characters) with nodejs

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

StripColorCodes

When using libs like colors your shell is beautifull but if you store the result in a file, it's not so good :-/

$ vim myLog

20120413045946 ^[[34mdebug:  ^[[39m […n/my-service] Starting my-service on 0.0.0.0:8080 in dev mode·
20120413045946 ^[[34mdebug:  ^[[39m […n/my-service] my-service started.·

You have all those ugly codes ^[[34m everywhere in your logs.

STOP worring about this, use StripColorCodes !

$ npm install -g stripcolorcodes

You can use it with unix pipe:

$ cat /root/.forever/T9ZW.log | stripcolorcodes
20120413045946 debug:   […n/my-service] Starting my-service on 0.0.0.0:8080 in dev mode
20120413045946 debug:   […n/my-service] my-service started.

Or with a file:

$ stripcolorcodes /root/.forever/T9ZW.log
20120413045946 debug:   […n/my-service] Starting my-service on 0.0.0.0:8080 in dev mode
20120413045946 debug:   […n/my-service] my-service started.

Or programmatically:

var stripColorCodes = require('stripcolorcodes');

fs.readFile(file, function(err, data){
  if(err) return console.error(err);
  process.stdout.write(stripcolorcodes(data.toString()));
});

Enjoy !

LICENCE MIT

FAQs

Package last updated on 13 Apr 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc