JSPM

jsdom

0.1.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32754131
  • Score
    100M100P100Q217815F

CommonJS implementation of the DOM intended to be platform independent and as minimal/light as possible while completely adhering to the w3c DOM specifications.

Package Exports

  • jsdom
  • jsdom/lib/jsdom
  • jsdom/lib/jsdom/browser
  • jsdom/lib/jsdom/browser/domtohtml
  • jsdom/lib/jsdom/browser/index
  • jsdom/lib/jsdom/level1/core
  • jsdom/lib/jsdom/level2/core
  • jsdom/lib/jsdom/level2/html
  • jsdom/package
  • jsdom/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsdom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jsdom

CommonJS implementation of the DOM intended to be platform independent and as minimal/light as possible while completely adhering to the w3c DOM specifications.

Currently Implemented and w3c Compliant:

  • DOM Level 1 (html/svg/xml)
  • Browser (BOM) Augmentation (getElementsByClassName, getElementById, etc..)

Note: Running the tests now requires mjsunit.runner

see: testlog for w3 test compliance

see: plan for roadmap and thoughts about this project

see: project site for additional information

Examples

jQuery

  var sys    = require("sys"),
      jsdom  = require(__dirname + "/../../lib/jsdom"),
      window = jsdom.jsdom().createWindow();
  
  // this also works:
  // jQueryTag.src = "http://code.jquery.com/jquery-1.4.2.js";
  jsdom.jQueryify(window, __dirname + "/jquery.js", function() {
    window.jQuery('body').append("<div class='testing'>Hello World, It works!</div>");
    sys.puts(window.jQuery(".testing").text());
  });