Skip to content

kaisarsnippets/js-tagfun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TagFun

[js] Replace content within tags with function's output.

Install

npm install kc-tagfun

Use

var tagfun = require('kc-tagfun');
var tg1 = '{{'; // Open tag
var tg2 = '}}'; // Close tag
var tpl = '{{2+2}} is a number'; // Template
var str = tagfun(tpl, tg1, tg2, function(c){
    return eval(c);
}); console.log(str);

About

[js] Replace content within tags with function's output.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published