Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

altaywtf/console-style-parser

Repository files navigation

Console Style Parser

Build Status npm npm

A simple module for parsing console.log colors to an array of objects.

Installation

npm install console-style-parser --save

Usage

const CSP = require('console-style-parser');

const egLog = ['%cExample %coutput with %c%s', 'color: red', 'color: green', 'color: blue', 'colors!'];
const parsedLog = CSP.parse(egLog);

/*
 [ 
	{ content: 'Example ', color: 'red' },
  	{ content: 'output with ', color: 'green' },
  	{ content: 'colors!', color: 'blue' } 
  ]
 */

About

A simple module for parsing console.log colors to an array of objects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published