@atlach/jq
v0.0.3
Published
Returns a jQuery instance in the browser and a compatible Cheerio instance on the server
Downloads
3
Readme
@atlach/jq
Returns a jQuery instance in the browser and a compatible Cheerio instance on the server.
const JQ = require('@atlach/jq');
console.log(JQ.env); // output -> browser/server
// we need to pass in the HTML document.
const $ = JQ.load(`<a href="https://npmjs.com">npm</a>`); // in the server
// we would not need to pass in.
const $ = JQ.load(); // in the browser
$('a').text()