chalk-twig-filters 0.0.3

A twig plugin to provide filters for coloring terminal output with chalk.'

Homepage: https://github.com/tizzo/chalk-twig-filter

Platform: npm

Language: JavaScript

License: CNRI-Python-GPL-Compatible

View on registry: https://www.npmjs.com/package/chalk-twig-filters/

Install: npm install chalk-twig-filters


Chalk Twig Filters

Build Status Coverage Status

Adds all configured chalk styles (sometimes referred to as themes) as twig.js filters.

Usage

Basic usage:

var Twig = require('twig');
require('chalk-twig-filters')(Twig);

That's it! Now you can use twig to render colored text for the console like so:

var Twig = require('twig');
require('./index')(Twig);
var someObject = {
 message: 'something wicked this way comes',
 date: new Date().getTime(),
};
var template = Twig.twig({data: '{{ date | date("m/d/Y h:m:s") | blue | underline}}: {{ message | cyan }}'});
console.log(template.render(someObject));

Advanced usage:

If you're doing anything clever like custom themes in chalk you can hand in the chalk instance to use. All styles should be automatically detected and filterified dynamically. All you have to do is hand in chalk as a second argument.

var Twig = require('twig');
var chalk = require('chalk');
// Configure chalk, add some theme combo, etc...
require('chalk-twig-filters')(Twig, chalk);
веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей

Dependencies

Development Dependencies


GitHub Repository

tizzo/chalk-twig-filters tizzo/chalk-twig-filters

A twig plugin to provide filters for coloring terminal output with chalk.

Language: JavaScript

Created: August 08, 2014 22:11

Last updated: September 23, 2014 22:49

Last pushed: September 24, 2014 20:06

Size: 176 KB

Stars: 0

Forks: 0

Watchers: 1

Open issues: 1

Top Contributors

Howard Tyson

Releases

  • 0.0.3 - September 23, 2014 22:49
  • 0.0.2 - August 13, 2014 03:24
  • 0.0.0 - August 11, 2014 01:54

Related Projects

igraal/twig-assetic-filter-bundle v1.0
Twig Assetic Filter Bundle for Symfony
Packagist - PHP - MIT - Published over 1 year ago - 2 stars
chalk 1.0.0
Terminal string styling done right. Much color.
npm - JavaScript - MIT - Updated about 1 month ago - 1,652 stars
chalk256 5.1.0
crayon - Add colors to text on your terminal. A faster replacement for chalk that also adds 256 c...
npm - CoffeeScript - MIT - Updated 10 months ago - 7 stars
colorodo 1.0.0
Colored output for Terminal.
npm - JavaScript - MIT - Published about 3 years ago - 1 stars
crayon-terminal 3.0.0
crayon - Add colors to text on your terminal. A faster replacement for chalk that also adds 256 c...
npm - CoffeeScript - MIT - Published 9 months ago - 7 stars
веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей