marianoguerra / json.human.js

Convert JSON to human readable HTML
http://marianoguerra.github.io/json.human.js/
975 stars 79 forks source link

old jsdom version #30

Closed LorenzBischof closed 9 years ago

LorenzBischof commented 9 years ago

Could you please update the jsdom version? I can't install with npm because it throws an error. Newer jsdom versions don't require contextify anymore.

marianoguerra commented 9 years ago

hi, latest version doesn't depend on external libraries, just removed it, let me know if it works or you need something else.

thanks for reporting!

LorenzBischof commented 9 years ago

works thanks!

LorenzBischof commented 9 years ago

How would I use the latest version in node without external libraries? It fails when trying to access document.

marianoguerra commented 9 years ago

no idea, I don't use nodejs, do you know a way to make it work? maybe some shim for the document object or something?

LorenzBischof commented 9 years ago

yeah. something like domjs or cheerio. I'll try using cheerio since it's lighter than domjs and report back so you can add it in the documentation.

LorenzBischof commented 9 years ago

Got it working with jsdom. I had to use an older version because we don't use node 4.0 in production yet. I used v3.1.2 but a newer version might also work and if you have node 4.0 then the newest version should also work. Just declare document before using json.human.js: document = jsdom.jsdom(); Make sure you don't add "var" because then it wont work.

I would love to use cheerio but I couldn't find out how to access the document...