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

Usage no npm install needed!

<script type="module">
  import yoYoify from 'https://cdn.skypack.dev/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.


npm install yo-yoify --save-dev


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

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

see also

  • babel-plugin-yo-yoify — yo-yoify as a Babel transform, works with any build setup that supports Babel


(c) 2016 Kyle Robinson Young. MIT License