Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including thindom with all npm packages installed. Try it out:

var thindom = require("thindom")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

thindom v1.1.4

Inspired by jQuery, this simple library lets you create DOM elements really fast, with significantly more expressiveness than native DOM methods.

ThinDOM: a thin DOM wrapper

Inspired by jQuery, this simple library lets you create DOM elements really fast, with significantly more expressiveness than native DOM methods.

How fast? Super fast.

Usage


captionDOM = ThinDOM div 
  .attr 'class', 'caption'
  .append ThinDOM 'div' 
  .attr 'class', 'votes'
  .append ThinDOM 'a' 
  .attr 'class': 'up', 'href': '#'
  .append ThinDOM 'a' 
  .attr 'class': 'down', 'href': '#'
  .append ThinDOM 'div'
  .attr 'class', 'meta'
  .append ThinDOM 'span'
  .text author + ' - '
  .append ThinDOM 'span'
  .text points + ' point' + plural
  .append ThinDOM 'p' 
  .html body 
  .get() 
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free