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 zeptodom with all npm packages installed. Try it out:

var zeptodom = require("zeptodom")

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

zeptodom v0.0.3

ZeptoDOM

ZeptoDOM is a simple Node.js module for accessing the contents of pages using Zepto or jQuery.

Currently zdom just wraps jsdom. It was developed as a piece of a crawler I'm working on and is designed to have a small features set.

usage:

var zdom = require('zdom');

var tab = new zdom.tab();

tab
  .set('library', 'jquery') // the default is 'zepto', anything else should be a jsdom.scripts arg
  // TODO .set('follow redirects', true)
  // TODO .set('user agent', 'chrome')
  .navigate('http://google.com') // returns a q promise
  .then(function ($, window) {
    tab
      .navigate($('.result').get(0).href)
      .then(function(){
        //down the rabbit hole you go
      })
  })
  .fail(function (error) {
    console.log('fall back, fall back!');
  });

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