Home

Awesome

yo-yoify

NPM version build status build status Downloads js-standard-style

Transform choo, yo-yo, or bel template strings into pure and fast document calls.

install

npm install yo-yoify --save-dev

usage

When using Browserify, use as a global transform:

browserify entry.js -g yo-yoify -o bundle.js

how this works

yo-yo and bel, without this transform, pass template literals to hyperx. hyperx then parses and extracts the tags. bel then turns those tags into calls to document.createElement().

When using this transform, your template literals:

var msg = 'hello!'
var element = yo`<div>${msg}</div>`

Transform into direct calls to the document:

var msg = 'hello!'
var element = (function () {
  var bel0 = document.createElement("div")
  appendChild(bel0, [arguments[0]])
  return bel0
}(msg))

Which means, way better performance and compatibility with older browsers.

see also

license

(c) 2016 Kyle Robinson Young. MIT License