Novice, Practiced, Mastered

    ansi-style-parser

    3.0.1 • Public • Published

    ansi-style-parser

    build status

    Parse ANSI colors and styles

    Install

    npm install ansi-style-parser

    Usage

    var c = require('chalk');
    var parser = require('ansi-style-parser');
    
    var txt = 'Some ';
    txt += c.bold.green('styled ' + c.underline.bgBlack('text') + c.red('!'));
    
    console.log(parser(txt));

    Output:

    [ { styles: [],
        text: 'Some ' },
    
      { styles: [ 'bold', 'green' ],
        text: 'styled ' },
    
      { styles: [ 'bold', 'green', 'underline', 'bgBlack' ],
        text: 'text' },
    
      { styles: [ 'bold', 'red' ],
        text: '!' } ]

    License

    MIT

    Install

    npm i ansi-style-parser

    DownloadsWeekly Downloads

    4,248

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    6.75 kB

    Total Files

    6

    Last publish

    Collaborators

    • farskipper