{"name":"selector-lite","version":"20.2.0","license":"MIT","author":{"name":"Lauri Rooden","email":"lauri@rooden.ee"},"description":"A small pure-JavaScript CSS selector engine","keywords":["browser","css","selector","matches","closest","litejs"],"main":"selector.js","repository":{"type":"git","url":"git://github.com/litejs/selector-lite.git"},"bugs":{"url":"https://github.com/litejs/selector-lite/issues"},"jshintConfig":{"asi":true,"laxcomma":true,"maxdepth":6,"quotmark":"double","-W030":false},"litejs":{"build":["-r selector.js"]},"gitHead":"30aff3a9fffdd8b32b5711c66cf096556977f26d","homepage":"https://github.com/litejs/selector-lite#readme","_id":"selector-lite@20.2.0","_nodeVersion":"8.16.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-wCg7RJZtBZi70ikeV+TM2aoC1NPMo4TRYY7/1Gp6yFYS1PddUlpcCi1FWbI4pWXwVWnh1el4UU6m/9xLdcZC7A==","shasum":"86fc2c5d9fd6e8c7b42384302241deedd4b9e610","tarball":"http://registry-npm.ywwl.com/selector-lite/download/selector-lite-20.2.0.tgz","fileCount":3,"unpackedSize":7700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOosVCRA9TVsSAnZWagAAAtIP/155d9HQpxnCoDXoOAG4\n2RAqHiAgGw8oU8b3DD8/kDRr5Enb6z3xdu5JnxtpZw1DFxLmdZh1PWYbWIHN\n2VekdxYoAbhAsJ2wPROqKWMqSaPZ7tSwFwurNRfNctlWKaG4uEaIvbHUTGfD\nV78a88TdmMiDS0SYYrIzBsbBIvH+GLCxp+W+LUagQAd2wqbrAQaE2ahKtlwY\n8pGNlZLsjgRAc+dDlUyT8HkpucDpyME7GJNPiYGPmEY4HXN89BaHtetLkRM3\nriFxXpvb8/xjZsZ/3b8A0tXbtXDKhKbFCf0HwA2yyVqxjCe24MhbGdDnCVpO\nfogoibyKbo/AqgmIQ1xAq5ongwv7Xll/oy4WYtBONPDeEaKz8BKE2QG7a6SV\nDXEy93O3GFzyVSemLvzIREv2BzP3+Akl2etixn0SaWGkTp0sqYCUBtGaQDbv\n36Ddv9tIbH/nei3AJLOnWTyc7OUwARPFdAfxENYre1XAHjp86Y/8tJX1Qt2q\nQtTdaTyzxZOT+oxI7F+xxuuUJ3vWe1luVYUmIR70pqnlyAtX3U4L3dqYD8zS\nzg9qDdc4UZ/CA0iANu4u8gdS3SBZdXvmGH86CLeqkXKmxzG6unyhPhAaFSh9\nOJqJS4YYyve3RBKyeJF5asKSFJdnQZpVMzPh6jn6DTcfeIfFWeUTc+zm6Gta\nBRFE\r\n=v/Ce\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/6Fy91RroaX5G4/YvTz6l5p0LqRiNidmqej0DGM1mpAiBursngjNtpXZN9RDvf36Vds78u7vFmwwa9zuX8wRJ9KA=="}],"size":3333,"noattachment":false,"key":"/selector-lite/-/selector-lite-20.2.0.tgz"},"maintainers":[{"name":"lauriro","email":"lauri@rooden.ee"}],"_npmUser":{"name":"lauriro","email":"lauri@rooden.ee"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/selector-lite_20.2.0_1580894996736_0.8353004789398235"},"_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":1580894996884,"_cnpm_publish_time":1580894996884,"dist-tags":{"latest":"23.1.0"}}