{"name":"selector-lite","version":"22.10.1","description":"A small pure-JavaScript CSS selector engine","license":"MIT","author":{"name":"Lauri Rooden","email":"lauri@rooden.ee"},"keywords":["browser","css","selector","matches","closest","litejs"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/litejs/selector-lite.git"},"bugs":{"url":"https://github.com/litejs/selector-lite/issues"},"scripts":{"test":"c8 -r lcov -r text-summary --check-coverage --100 lj test --brief test/index.js"},"devDependencies":{"@litejs/cli":"22.8.0","c8":"7.12.0"},"litejs":{"build":false,"lint":"jshint *.js"},"jshintConfig":{"asi":true,"laxcomma":true,"maxdepth":6,"quotmark":"double"},"gitHead":"01b1fdf068e92955effc64b17859010eb3a85c11","homepage":"https://github.com/litejs/selector-lite#readme","_id":"selector-lite@22.10.1","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-4GgyD125GPEgwyvvz6vSFwFw8uRHr2l12/FjufEIVzBwXjcb40iWX/MQz3XG5N0pT7+4Opwh00J7sUAEo7L0eQ==","shasum":"3c285e9ad72db2aa8983e3784e6a8da7e8aeac3c","tarball":"http://registry-npm.ywwl.com/selector-lite/download/selector-lite-22.10.1.tgz","fileCount":3,"unpackedSize":7456,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGytUxyhrMVOsZAX/k490kDyUvEtWoAwdnA1c+vsfuGSAiEAxEQMgfLCBYm8OA8Ls+ixJJRKwnTgDayWuOOsttmzBUM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWprsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoziw//UFfntQsXCS3FGy3biMyXoxKuW/6XTJm6T4SJP7AOUJIOypQB\r\nMq28dTftDVkpds3G2aDIqgyIuT+Be7jgKuNOyPQaB5fQoAeknVb61G8rLALf\r\nT8orePY+X/SGgouIdl93zGjKUhbKjPQzclFOfqCcEjljKOvoi/TE8uRxVeEA\r\nqsy70SoaDuJzlMw0peRIniEGXULaXkyK/aTRYWaDc/xSFxVFTOFOtogfGJjQ\r\nAjlFzD8zLaZY5fU3C+xjBAKqQpTGQErYrXBcyNaVRcSV6AP9Lgc50ATip9cV\r\nXS56AExPkttvk8SplmqFHwWWWGRgDRNsBRfb2E4EY3zV8XbYgpgYts5kee9t\r\nDadeTLDOQd1i17RT9cTmo0viU0rQzZhC3xNRPU+wP2xpbVBXnAHKinAujNfq\r\nfN01emdsdTBcijtRNk5ME8lzMwGPrKmdV7FRzA/v4zZeDfaz2GiK2JVfPp8S\r\n+tEaspgKOP0FG9VHw6BiW+m0R7aAGFyY2iwCjahQVVveZ7PrTppZlNUaxRF7\r\nMU2ZV2YtMDllB7FKAIpRabTqTAuzvdyzYFTLGGSNxakYoPnIyHgRx5d/m4ak\r\n3rnlcFjkB01ZAEiOqlejM8x+156dko3dzMOk6r3lxyJcVlw7IRwIBCGToOQJ\r\nJLTyTu+F/qY1z74pUn16fWidSwDLjhxQcKo=\r\n=O6pG\r\n-----END PGP SIGNATURE-----\r\n","size":3240,"noattachment":false,"key":"/selector-lite/-/selector-lite-22.10.1.tgz"},"_npmUser":{"name":"lauriro","email":"lauri@rooden.ee"},"directories":{},"maintainers":[{"name":"lauriro","email":"lauri@rooden.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/selector-lite_22.10.1_1666882284006_0.0938772259891485"},"_hasShrinkwrap":false,"deprecated":"It is merged into dom-lite. Use require('dom-lite/selector')","readme":"[3]: https://badgen.net/coveralls/c/github/litejs/selector-lite\n[4]: https://coveralls.io/r/litejs/selector-lite\n[5]: https://badgen.net/packagephobia/install/selector-lite\n[6]: https://packagephobia.now.sh/result?p=selector-lite\n[7]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label\n[8]: https://www.buymeacoffee.com/lauriro\n\n\nSelector lite &ndash; [![Coverage][3]][4] [![Size][5]][6] [![Buy Me A Tea][7]][8]\n=============\n\n## DEPRECATED! It is merged into dom-lite. Use `require('dom-lite/selector')`\n\nA small pure-JavaScript CSS selector engine.\n\n - no library dependencies\n - CSS 3 Selector support\n - only 2KB minified and 1KB gzipped\n\nExamples\n--------\n\n```javascript\nvar selector = require(\"selector-lite\")\n\n// Can be used to implement browser built-in functions.\n\nfunction getElementById(id) {\n    return selector.find(this, \"#\" + id, true)\n}\nfunction getElementsByTagName(tag) {\n    return selector.find(this, tag)\n}\nfunction getElementsByClassName(sel) {\n    return selector.find(this, \".\" + sel.replace(/\\s+/g, \".\"))\n}\nfunction querySelector(sel) {\n    return selector.find(this, sel, true)\n}\nfunction querySelectorAll(sel) {\n    return selector.find(this, sel)\n}\n```\n\nMethods\n-------\n\n - selector.`find(node, selector, returnFirstMatch)` - Find matching elements like querySelector.\n - selector.`matches(node, selector)` - Returns a Boolean indicating whether or not\n   the element would be selected by the specified selector string.\n - selector.`closest(selector)` - Returns the Element, descendant of this element\n   (or this element itself), that is the closest ancestor of the elements\n   selected by the selectors given in parameter.\n - selector.`next(selector)` - Retrieves the next sibling that matches selector.\n - selector.`prev(selector)` - Retrieves the preceding sibling that matches selector.\n\n\nCustom selectors\n----------------\n\nCustom selector can be added to selector.selectorMap,\nwhere method shortcuts are available (m->matches, c->closest, n->next, p->prev).\n\n - `_` - node.\n - `v` - part between `()` in `:nth-child(2n+1)`.\n - `a` and `b` can be used as temp variables.\n\n```javascript\n// Add `:input` selector\nselector.selectorMap.input = \"_.tagName=='INPUT'\"\n\n// Add `:val()` selector\nselector.selectorMap.val = \"_.value==v\"\n```\n\n## Contributing\n\nFollow [Coding Style Guidelines](https://github.com/litejs/litejs/wiki/Style-Guidelines)\n\nRun tests\n\n```\nnpm install\nnpm test\n```\n\n## External links\n\n[GitHub repo](https://github.com/litejs/selector-lite) |\n[npm package](https://npmjs.org/package/selector-lite) |\n[DOM spec](https://dom.spec.whatwg.org/) |\n[Selectors Level 3](http://www.w3.org/TR/selectors/) |\n[Coveralls coverage](https://coveralls.io/github/litejs/selector-lite)  \n[Buy Me A Tea][8]\n\n\n## Licence\n\nCopyright (c) 2015-2021 Lauri Rooden &lt;lauri@rooden.ee&gt;  \n[The MIT License](http://lauri.rooden.ee/mit-license.txt)\n\n\n","publish_time":1666882284165,"_cnpm_publish_time":1666882284165,"dist-tags":{"latest":"23.1.0"}}