A JavaScript implementation of W3C DOM for Node.js. It supports
DOMParser and XMLSerializer interface such as in browser, it can also provide a window with a document for jQuery to work in Node.js.
npm install ndjs
Follow the instruction of the environments you are using.
var ndjs = require('ndjs');
var html = '<html><body>NDjs</body></html>';
var dom = new ndjs.DOMParser().parseFromString(html);
var window = ndjs.window(dom);define(['ndjs'], function(ndjs){
var html = '<html><body>NDjs</body></html>';
var dom = new ndjs.DOMParser().parseFromString(html);
var window = ndjs.window(dom);
});- Jianwei Liu
NDjs is released under the MIT license.