{"_id":"cssauron","_rev":"93217","name":"cssauron","description":"create matching selectors from css for your very own nested object hierarchy","dist-tags":{"latest":"1.4.0"},"maintainers":[{"name":"chrisdickinson","email":""}],"time":{"modified":"2021-06-03T10:30:57.000Z","created":"2012-11-22T01:46:09.131Z","1.4.0":"2016-05-07T20:19:26.512Z","1.3.0":"2016-05-07T20:14:53.259Z","1.2.0":"2014-08-11T18:20:15.760Z","1.1.2":"2014-06-05T06:03:55.203Z","1.1.1":"2014-05-18T07:55:21.510Z","1.1.0":"2013-11-19T04:17:10.322Z","1.0.0":"2013-10-24T07:33:24.788Z","0.2.1":"2013-07-16T17:47:25.315Z","0.2.0":"2013-07-15T19:43:24.133Z","0.1.1":"2012-12-28T00:03:41.651Z","0.1.0":"2012-12-28T00:02:04.427Z","0.0.3":"2012-12-21T07:03:19.650Z","0.0.2":"2012-11-24T01:17:19.508Z","0.0.0":"2012-11-22T01:46:09.131Z"},"users":{"mikemimik":true},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"versions":{"1.4.0":{"name":"cssauron","version":"1.4.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"gitHead":"ae57ae70c65961457f1f7481d945ed47dfdd2f20","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"homepage":"https://github.com/chrisdickinson/cssauron#readme","_id":"cssauron@1.4.0","_shasum":"a6602dff7e04a8306dc0db9a551e92e8b5662ad8","_from":".","_npmVersion":"3.8.7","_nodeVersion":"5.4.1","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"dist":{"shasum":"a6602dff7e04a8306dc0db9a551e92e8b5662ad8","size":6794,"noattachment":false,"key":"/cssauron/-/cssauron-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.4.0.tgz"},"maintainers":[{"name":"chrisdickinson","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/cssauron-1.4.0.tgz_1462652364161_0.7332158519420773"},"publish_time":1462652366512,"_cnpm_publish_time":1462652366512,"_hasShrinkwrap":false},"1.3.0":{"name":"cssauron","version":"1.3.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"gitHead":"9b09d463161d29c3e8937cb494575234dbc3668b","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"homepage":"https://github.com/chrisdickinson/cssauron#readme","_id":"cssauron@1.3.0","_shasum":"39095ff486f6fd9c50b5acb6cca2b94c718e0e16","_from":".","_npmVersion":"3.8.7","_nodeVersion":"5.4.1","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"dist":{"shasum":"39095ff486f6fd9c50b5acb6cca2b94c718e0e16","size":6645,"noattachment":false,"key":"/cssauron/-/cssauron-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.3.0.tgz"},"maintainers":[{"name":"chrisdickinson","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/cssauron-1.3.0.tgz_1462652091040_0.5277433814480901"},"publish_time":1462652093259,"_cnpm_publish_time":1462652093259,"_hasShrinkwrap":false},"1.2.0":{"name":"cssauron","version":"1.2.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"gitHead":"92a4aa28592bd5a76d7c559fad87654863411990","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"homepage":"https://github.com/chrisdickinson/cssauron","_id":"cssauron@1.2.0","_shasum":"7ec0a67ced40fad67cf47dd699783564c8f2b3e9","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"dist":{"shasum":"7ec0a67ced40fad67cf47dd699783564c8f2b3e9","size":6032,"noattachment":false,"key":"/cssauron/-/cssauron-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.2.0.tgz"},"publish_time":1407781215760,"_cnpm_publish_time":1407781215760,"_hasShrinkwrap":false},"1.1.2":{"name":"cssauron","version":"1.1.2","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"homepage":"https://github.com/chrisdickinson/cssauron","_id":"cssauron@1.1.2","_shasum":"1c17c839126cc76ac3fb491d10e9665e4d70e664","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"dist":{"shasum":"1c17c839126cc76ac3fb491d10e9665e4d70e664","size":5866,"noattachment":false,"key":"/cssauron/-/cssauron-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.1.2.tgz"},"publish_time":1401948235203,"_cnpm_publish_time":1401948235203,"_hasShrinkwrap":false},"1.1.1":{"name":"cssauron","version":"1.1.1","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"homepage":"https://github.com/chrisdickinson/cssauron","_id":"cssauron@1.1.1","_shasum":"60c425ca019d0e7e3f89150029389f0b4b1a897f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"dist":{"shasum":"60c425ca019d0e7e3f89150029389f0b4b1a897f","size":5826,"noattachment":false,"key":"/cssauron/-/cssauron-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.1.1.tgz"},"publish_time":1400399721510,"_cnpm_publish_time":1400399721510,"_hasShrinkwrap":false},"1.1.0":{"name":"cssauron","version":"1.1.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"_id":"cssauron@1.1.0","dist":{"shasum":"1f2c2c7108bf3ce49a39edb5085ec1c99c5e25ec","size":5800,"noattachment":false,"key":"/cssauron/-/cssauron-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.1.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1384834630322,"_cnpm_publish_time":1384834630322,"_hasShrinkwrap":false},"1.0.0":{"name":"cssauron","version":"1.0.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"devDependencies":{"tape":"~2.0.0"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"_id":"cssauron@1.0.0","dist":{"shasum":"3c9891541075be90ee59c0c2a3d400e4fffec42d","size":5598,"noattachment":false,"key":"/cssauron/-/cssauron-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-1.0.0.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1382600004788,"_cnpm_publish_time":1382600004788,"_hasShrinkwrap":false},"0.2.1":{"name":"cssauron","version":"0.2.1","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"_id":"cssauron@0.2.1","dist":{"shasum":"8bada27f47bfaed2ff5e39c1aa05dde0780ab3d5","size":5255,"noattachment":false,"key":"/cssauron/-/cssauron-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.2.1.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1373996845315,"_cnpm_publish_time":1373996845315,"_hasShrinkwrap":false},"0.2.0":{"name":"cssauron","version":"0.2.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"_id":"cssauron@0.2.0","dist":{"shasum":"d23ecc97c91e9fcb47e81e11590f7385c10708a4","size":5239,"noattachment":false,"key":"/cssauron/-/cssauron-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.2.0.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1373917404133,"_cnpm_publish_time":1373917404133,"_hasShrinkwrap":false},"0.1.1":{"name":"cssauron","version":"0.1.1","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"readmeFilename":"README.md","_id":"cssauron@0.1.1","dist":{"shasum":"7aec7690c6052d16ea0819cfa7ea7e1c870a2998","size":4850,"noattachment":false,"key":"/cssauron/-/cssauron-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.1.1.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1356653021651,"_cnpm_publish_time":1356653021651,"_hasShrinkwrap":false},"0.1.0":{"name":"cssauron","version":"0.1.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","dependencies":{"through":"X.X.X"},"readmeFilename":"README.md","_id":"cssauron@0.1.0","dist":{"shasum":"b6f52c35179e8e564c995c9ac9b63a5d39eae4e9","size":4851,"noattachment":false,"key":"/cssauron/-/cssauron-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.1.0.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1356652924427,"_cnpm_publish_time":1356652924427,"_hasShrinkwrap":false},"0.0.3":{"name":"cssauron","version":"0.0.3","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","readmeFilename":"README.md","_id":"cssauron@0.0.3","dist":{"shasum":"d447585640430100dfd861f3c95901cb665a15e5","size":3986,"noattachment":false,"key":"/cssauron/-/cssauron-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.0.3.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1356073399650,"_cnpm_publish_time":1356073399650,"_hasShrinkwrap":false},"0.0.2":{"name":"cssauron","version":"0.0.2","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","_id":"cssauron@0.0.2","dist":{"shasum":"6812797e6f2ac2cb9a695a92df7c420ee4dc6a62","size":3971,"noattachment":false,"key":"/cssauron/-/cssauron-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.0.2.tgz"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1353719839508,"_cnpm_publish_time":1353719839508,"_hasShrinkwrap":false},"0.0.0":{"name":"cssauron","version":"0.0.0","description":"create matching selectors from css for your very own nested object hierarchy","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/cssauron.git"},"keywords":["css","selector","parser","match"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","_id":"cssauron@0.0.0","dist":{"shasum":"745d136dc1dc8c2c72c44f9c5e20cafb768e8fdc","size":3989,"noattachment":false,"key":"/cssauron/-/cssauron-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cssauron/download/cssauron-0.0.0.tgz"},"maintainers":[{"name":"chrisdickinson","email":""}],"publish_time":1353548769131,"_cnpm_publish_time":1353548769131,"_hasShrinkwrap":false}},"readme":"# cssauron\n\nbuild a matching function in CSS for any nested object structure!\n\n```javascript\nvar language = require('cssauron')({\n    tag: 'tagName'\n  , contents: 'innerText'\n  , id: 'id'\n  , class: 'className'\n  , parent: 'parentNode'\n  , children: 'childNodes'\n  , attr: 'getAttribute(attr)'\n})\n\nvar selector = language('body > #header .logo')\n  , element = document.getElementsByClassName('logo')[0]\n\nif(selector(element)) {\n  // element matches selector\n} else {\n  // element does not match selector\n}\n```\n\nIt's easy to use with your favorite nested tree structures!\nDelicious with HTML! Digestable with JSON!\n\n| HTML | JSON | GLSL AST | JS AST (Esprima) |\n|------|------|----------|------------------------|\n| [cssauron-html](http://npm.im/cssauron-html) | [cssauron-json](http://npm.im/cssauron-json) | [cssauron-glsl](http://npm.im/cssauron-glsl) | [cssauron-falafel](http://npm.im/cssauron-falafel) |\n\n\n# API\n\n### require('cssauron')(options) -> selector factory\n\nImport `cssauron` and configure it for the nested object structure you'll\nwant to match against.\n\n#### options\n\n`options` are an object hash of lookup type to string attribute or `function(node)` lookups for queried\nnodes. You only need to provide the configuration necessary for the selectors you're planning on creating.\n(If you're not going to use `#id` lookups, there's no need to provide the `id` lookup in your options.)\n\n* `tag`: Extract tag information from a node for `div` style selectors.\n* `contents`: Extract text information from a node, for `:contains(xxx)` selectors.\n* `id`: Extract id for `#my_sweet_id` selectors.\n* `class`: `.class_name`\n* `parent`: Used to traverse up from the current node, for composite selectors `body #wrapper`, `body > #wrapper`.\n* `children`: Used to traverse from a parent to its children for sibling selectors `div + span`, `a ~ p`.\n* `attr`: Used to extract attribute information, for `[attr=thing]` style selectors.\n\n### selector_factory('some selector') -> match function\n\nCompiles a matching function.\n\n### match(node) -> false | node | [subjects, ...]\n\nReturns false if the provided node does not match the selector. Returns truthy if the provided\nnode *does* match. Exact return value is determined by the selector, based on\nthe [CSS4 subject selector spec](http://dev.w3.org/csswg/selectors4/#subject): if only\na single node is matched, only that node is returned. If multiple subjects are matched,\na deduplicated array of those subjects are returned.\n\nFor example, given the following HTML (and `cssauron-html`):\n\n```html\n<div id=\"gary-busey\">\n    <p>\n        <span class=\"jake-busey\">\n        </span>\n    </p>\n</div>\n```\n\nChecking the following selectors against the `span.jake-busey` element yields:\n\n - `#gary-busey`: `false`, no match.\n - `#gary-busey *`: `span.jake-busey`, a single match.\n - `!#gary-busey *`: `div#gary-busey`, a single match using the `!` subject selector.\n - `#gary-busey *, p span`: `span.jake-busey`, a single match, though both selectors match.\n - `#gary-busey !* !*, !p > !span`: `[p, span.jake-busey]`, two matches.\n\n## Supported pseudoclasses \n\n - `:first-child`\n - `:last-child`\n - `:nth-child`\n - `:empty`\n - `:root`\n - `:contains(text)`\n - `:any(selector, selector, selector)`\n\n## Supported attribute lookups\n\n - `[attr=value]`: Exact match\n - `[attr]`: Attribute exists and is not false-y.\n - `[attr$=value]`: Attribute ends with value\n - `[attr^=value]`: Attribute starts with value\n - `[attr*=value]`: Attribute contains value\n - `[attr~=value]`: Attribute, split by whitespace, contains value.\n - `[attr|=value]`: Attribute, split by `-`, contains value.\n\n\n","_attachments":{},"homepage":"https://github.com/chrisdickinson/cssauron#readme","bugs":{"url":"https://github.com/chrisdickinson/cssauron/issues"},"license":"MIT"}