Socket
Socket
Sign inDemoInstall

yo-yoify

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yo-yoify

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


Version published
Weekly downloads
614
increased by45.84%
Maintainers
4
Weekly downloads
 
Created
Source

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

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

license

(c) 2016 Kyle Robinson Young. MIT License

Keywords

FAQs

Package last updated on 02 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc