Skip to content
/ tage Public

template tags easily made from other functions

License

Notifications You must be signed in to change notification settings

bengl/tage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tage

js-standard-style

tage will turn your functions into template tags.

Just take a function that has a string as its first argument, then pass it into tage to get a function that works as a template tag, returning a new function.

The new function acts exactly as the old one as well, so you can use it both ways.

NOTE: This only works in environments that support template tags.

Example

var tage = require('tage')
var assert = require('assert')

function foo(str, arg1, arg2) {
  return str + arg1 + arg2
}

var tageFoo = tage(foo)

assert.equal(tageFoo('one', 'two', 'three'), 'onetwothree')
assert.equal(tageFoo `one` ('two', 'three'), 'onetwothree')

License

See LICENSE.txt

About

template tags easily made from other functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published