The concise CSS selector engine
Nut is a concise query selector engine that just allows you to do extremely simple queries.
querySelectorAll and then faster than all selector engines. Nut does not implement request caching, to avoid unecessary code additions and performance loss, because the user can easily keep a request and pass it as a context to another request.
Here's it can handle :
#foosection.bar psection #foo .bar pdiv, #foo, .bar
And here's it can't :
div *div#foo div.bardiv > pdiv + p
So, all pseudo-classes, attribute selectors and other advanced syntax are not allowed. But, let's dig in it :
// Return an arraynut'#foo';
Of course, queries can have a context :
// Get nodes from the #foo contextnut'.bar p'nut'#foo'0;
And that's all you need to know ;)
Nut is compatible with ender and supports some useful syntax.
Selecting nodes, as usually:
Selecting existing nodes:
Nut is published under the MIT license.