typo

Typo is a scalable template engine designed for cli, which help to format your console output! Typo supports full 256-color ANSI background and foreground, underline, italic, etc.

Typo

Make typography beautiful in command-line.

A formated stdout tool and parser which cortex uses and is tiny, fast, and of high scalability.

npm install typo --save
var typo = require('typo');

typo.log("There's once in a {{blue blue}} moon~");
typo.log('{{1}}{{2}}{{3}}', ['a', 'b']); // print 'ab3'

typo.log('{{a}}{{b}}{{c.a}}{{c.b}}', {a: 1, b:2, c: {a: 3}}); // print '123c.b'
typo.log('{{bold abc}}');         // print a bold 'abc'
typo.log('{{bold|blue abc}}');    // print a blue bold 'abc'
typo.register('sum', function(value){{
    return (Array.isArray(value) ? value : [value])
        .reduce(function(prev, current){
            return (parseInt(current) || 0) + prev;
        }, 0);
}});

typo.log('{{sum 1,2,3}}');         // print 6
typo.log('{#list}3{/list}');

Which will not show up before typo@0.2.0.

if you like typo, there will be a billion thanks if you fork typo and make pull request.