Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.
/ archived-colors-tmpl Public archive

Simple templating for applying colors.js to strings

License

Notifications You must be signed in to change notification settings

rvagg/archived-colors-tmpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colors-tmpl - Super-simple templating for colors.js

var colorsTmpl = require('colors-tmpl')

// simple:
colorsTmpl('{red}this should be red{/red}')
// same as → 'this should be red'.red

// fancy:
colorsTmpl('lotsa colours: {red}red{/red}, {green}green{/green}, {blue}blue{/blue}, yeehaw!')
// same as → 'lotsa colours: ' + 'red'.red + ', ' + 'green'.green + ', ' + 'blue'.blue + ', ' + 'yeehaw!'

// fancier:
colorsTmpl(
      '{bold}colours {red}within {green}colours{/green} within {yellow}colours, {underline}oh my!{/underline}{/yellow}{/red} EEEK!{/bold}'
    )
// same as → 'colours ' + ('within ' + 'colours'.green + ' within ' + ('colours, ' + 'oh my!'.underline).yellow).red + ' EEEK!').bold

License

colors-tmpl is Copyright (c) 2014 Rod Vagg @rvagg and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

About

Simple templating for applying colors.js to strings

Resources

License

Stars

Watchers

Forks

Packages

No packages published