colors-tmpl
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -42,2 +42,4 @@ /*! | ||
module.exports = render | ||
// old style: | ||
module.exports.render = render |
@@ -8,3 +8,3 @@ { | ||
, "description": "Simple templating for applying colors.js to strings" | ||
, "version": "0.0.3" | ||
, "version": "0.1.0" | ||
, "homepage": "https://github.com/rvagg/colors-tmpl" | ||
@@ -11,0 +11,0 @@ , "keywords": [ "color", "colour", "colours", "colours", "colors.js", "templating", "templates" ] |
@@ -7,11 +7,11 @@ # colors-tmpl - Super-simple templating for [colors.js](https://github.com/Marak/colors.js) | ||
// simple: | ||
colorsTmpl.render('{red}this should be red{/red}') | ||
colorsTmpl('{red}this should be red{/red}') | ||
// same as → 'this should be red'.red | ||
// fancy: | ||
colorsTmpl.render('lotsa colours: {red}red{/red}, {green}green{/green}, {blue}blue{/blue}, yeehaw!') | ||
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.render( | ||
colorsTmpl( | ||
'{bold}colours {red}within {green}colours{/green} within {yellow}colours, {underline}oh my!{/underline}{/yellow}{/red} EEEK!{/bold}' | ||
@@ -22,2 +22,2 @@ ) | ||
*Copyright (c) 2012 [Rod Vagg](https://github.com/rvagg) ([@rvagg](https://twitter.com/rvagg))* | ||
*Copyright (c) 2012 [Rod Vagg](https://github.com/rvagg) ([@rvagg](https://twitter.com/rvagg))* |
26
test.js
@@ -22,3 +22,3 @@ #!/usr/bin/env node | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'{red}this should be red{/red}' | ||
@@ -31,3 +31,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'{green}this should be green{/green}' | ||
@@ -40,3 +40,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'{underline}this should be underlined{/underline}' | ||
@@ -49,3 +49,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'partial {red}red{/red} string' | ||
@@ -58,3 +58,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'partial {green}green{/green} string' | ||
@@ -67,3 +67,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'unmatched {green} tag, leave it alone' | ||
@@ -76,3 +76,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'nonsense {foobar} tag, leave it alone' | ||
@@ -85,3 +85,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'nonsense, matched {foobar}tag{/foobar}, leave it alone' | ||
@@ -94,3 +94,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'lotsa colours: {red}red{/red}, {green}green{/green}, {blue}blue{/blue}, yeehaw!' | ||
@@ -103,3 +103,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'{bold}colours {red}within {green}colours{/green} within {yellow}colours, {underline}oh my!{/underline}{/yellow}{/red} EEEK!{/bold}' | ||
@@ -112,3 +112,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'{red}red1{/red}, {red}red2{/red}, {red}red3{/red}' | ||
@@ -121,3 +121,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'\n{red}red1{/red}\n{red}red2{/red}\n{red}red3{/red}\n' | ||
@@ -130,3 +130,3 @@ ) | ||
assert( | ||
colorsTmpl.render( | ||
colorsTmpl( | ||
'\n{red}red1\nred2\nred3{/red}\n' | ||
@@ -133,0 +133,0 @@ ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10489
7
281
22