Closed simonexmachina closed 8 years ago
I just created a naive browserify bundle using browserify index.js -o bundle.js
and it comes out at 44K (11K gzipped). Does that sound about right, or is this including code that doesn't need to be included?
Yup. The usage examples are really not clear.
If I'm supposed to use this within Node, how can I tell the library the context? How can I load a specific HTML file?
If I'm supposed to use this within the browser, how am I supposed to bundle it from an NPM node-modules
folder?
The documentation assumes that people who want to use it are familiar with browserify, we should add more docs for people getting started...
just added this note: https://github.com/npm-dom/domquery/commit/1dd7104e57d304c7acef543fe9886670a353572a
Better than before! This just leaves an ambiguity: is it possible to use it in another context (i.e. not in the browser)?
of course not, it's made for DOM
Well, as obvious as it seems to you, it would probably be worth including in the README :)
It doesn't strike me as stupid to consider doing DOM-like manipulation on the backend. I would love to have a library that lets me load an HTML file/stream and manipulate it as easily as on the frontend.
cheerio does that: https://www.npmjs.org/package/cheerio
Thanks ;) that was just an explanation of why I think the expected usage should be more detailed :)
arright, added another commit for that: https://github.com/npm-dom/domquery/commit/3a5f8d4ea61f90868aa6c76a74057bdae60d7116
Straight to the point :wink:
I realise that I can probably use browserify, but I'm not really familiar with that. It'd be great if there were some instructions on how to use domquery in the browser.