{"name":"selector-lite","version":"23.1.0","description":"DEPRECATED! It is merged into dom-lite! 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"},"dependencies":{"dom-lite":"23.1.0"},"litejs":{},"gitHead":"7bc022371e38f97d0105cfd024fdcfebe3af5932","homepage":"https://github.com/litejs/selector-lite#readme","_id":"selector-lite@23.1.0","_nodeVersion":"19.3.0","_npmVersion":"9.3.1","dist":{"integrity":"sha512-ryf2r3WArgu1xlNdSS1woQzhTNdO2zu4YyvIqJ7isouQUQihjjI7m9HyZCcVEKoejYBJGrxWZA+RkSFFPLto9Q==","shasum":"9ce19e5dcf26a3153c07c493e77313809b02ce7d","tarball":"http://registry-npm.ywwl.com/selector-lite/download/selector-lite-23.1.0.tgz","fileCount":3,"unpackedSize":3481,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOGNdtvBqrM+N1dEvAJoQF6h6i0MM4LjRH8pb1g1KbugIgPXta6VtBhW/pnS/6/kCoaNLdvf4BtU+DsRSO8akNHfw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzT5SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhYA//bhz2STjMHDwPh0D6MEEBGPGac62hazON5VQ7rra/7O6+8kL2\r\nPuXNj9s52TBDoq745CVLi/jwk6PoYssTJlbeOVB+X+v5fhae5J2t5zzyMkwT\r\nvISvVx3IqU0wEs40OtcRMy8BKt+MQTOItLrb7VkugFOzNQohjLNRIZIdLCsR\r\nfcf4xtvFJe3fM6XSLp+p/P5Ba68MMh/FfF837Pn01xXAdGj60tAJP0RYAcH3\r\n4WbbvRf9tTtarz4bfXvRmdyjQjVX7/EsCFcsHY/oeGL805tH68fcI7ysMsun\r\n4g8d5ZvmLqL5ZeHS7sQKfCIkVZGk2akHlxa0sSFUm5bxrMk8/i3PxG///6VN\r\nv8CHPI6w3KiB9Es3VZEESSEejt4xUoSTZc0bWWYa6QIChV4+ccjM3NovajFM\r\ndxq2idW0/imcF8busFBCGrajFO0Zdjgt4/rmwYDdPXVMhNytiWrbh8rGD36r\r\nAER0JqN2FprOyntTi/yo1fCQEJl7kqJwlHXb/nCWjjmx4arTIVBMZZkNqetO\r\n5URsZetaSM5onKbTGeHsfrS342QIzv3kVcn8vRj9jxjSsIRiFZUkJUGNMNrK\r\nPh9qN+PDSDa5WSQrr1zo0R0Il3mXr0R9VmhPkunk+HJKDx13iB2M9QzKSx1x\r\nruzF6oytNHsyytvQbKCBiFERwqnz6QSU0eI=\r\n=3DYB\r\n-----END PGP SIGNATURE-----\r\n","size":1654,"noattachment":false,"key":"/selector-lite/-/selector-lite-23.1.0.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_23.1.0_1674395217961_0.544370446297461"},"_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":1674395218124,"_cnpm_publish_time":1674395218124,"dist-tags":{"latest":"23.1.0"}}