Maqentaer / dom2jsonml

Convert DOM to JSONML

Home Page:https://www.npmjs.com/package/dom2jsonml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#dom2jsonml

Convert DOM to JSONML

##Usage

var jsonMl = dom2jsonml( <Node> elem [, <func> filter( <array> jsonMl, <Node> elem)] [, <func> callback(err, <array> jsonMl)]);

##Examples

var dom2jsonml = require('dom2jsonml');
dom2jsonml(window.document.body, function(err, jsonMl){
  if(err) throw err;
  else console.log(JSON.stringify(jsonMl));
});
var dom2jsonml = require('dom2jsonml');
var jsonMl = dom2jsonml(window.document.body);
if(null === jsonMl) throw new Error("Invalid DOM");
else console.log(JSON.stringify(jsonMl));

##Installation

npm install dom2jsonml

Contributors

  • Maqentaer

MIT Licenced

About

Convert DOM to JSONML

https://www.npmjs.com/package/dom2jsonml

License:MIT License


Languages

Language:JavaScript 100.0%