jldom
A DOM implementation in CoffeeScript, full CSS3 support.
Last updated 6 years ago by jldailey .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jldom 
SYNC missed versions from official npm registry.

An implementation of the DOM in CoffeeScript/JavaScript

Intended for use in NodeJS.

I haven't checked the actual DOM compliance, but everything you need is there:

  • Full CSS3 support via NWMatcher.
  • A very tiny HTML parser.
  • DOM-compliant event binding and triggering (bubbling, cancelling, etc).
  • Coming soon: (optional) Mutation Events.

This is not a fork of jsdom.

It assumes the document is going to act like it would in a browser (e.g. it automatically gets a head and body).

No attempt has been made to support XML or Xpath or anything exotic.

Example:

document = require('jldom').createDocument()

document.body.innerHTML = "<div>Hello, World.</div>"

document.toString()
	=== "<html><head/><body><div>Hello, World.</div></body></html>"

document.querySelector("div").toString()
	=== "<div>Hello, World.</div>"

I built this to generate server-side HTML from a NodeJS application. Benchmarks reveal that this is a waste of time. I currently use it to unit test other javascript code that needs a reasonably well-behaved DOM to interact with.

Install:

npm install jldom

Or:

git clone git://github.com/jldailey/jldom.git
cd jldom
make

Current Tags

  • 0.1.4                                ...           latest (6 years ago)

14 Versions

  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.9                                ...           7 years ago
  • 0.0.8                                ...           7 years ago
  • 0.0.7                                ...           7 years ago
  • 0.0.6                                ...           7 years ago
  • 0.0.5                                ...           7 years ago
  • 0.0.4                                ...           8 years ago
  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 1
Last Month 21
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |