0.0.3 • Published 2 years ago
@atlach/jq v0.0.3
@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()