I installed jquery with : npm install jquery and then tried to run:
var $ = require('jquery');
console.log($('<a href="">hkjhjkh</a>').text());
I get this error, that I understand very well (no document in node.js!) :
Error( "jQuery requires a window with a document" )
How to make jQuery work without a document / window in node.js in such a simple case?
PS: I tried with: var $=require('jquery')(jsdom.jsdom().createWindow());, but unfortunately npm install jsdom gave me lots of make errors that I was unable to debug (that would be another question, so out of topic here).