{"id":16760333,"url":"https://github.com/ryanve/scan","last_synced_at":"2025-10-16T12:24:14.606Z","repository":{"id":66123103,"uuid":"9320290","full_name":"ryanve/scan","owner":"ryanve","description":"querySelectorAll selector engine","archived":false,"fork":false,"pushed_at":"2014-10-07T04:22:55.000Z","size":504,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T18:56:27.453Z","etag":null,"topics":["javascript","module","selector-engine"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/scan","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-09T12:08:13.000Z","updated_at":"2024-03-08T20:04:12.000Z","dependencies_parsed_at":"2023-02-19T22:50:33.618Z","dependency_job_id":null,"html_url":"https://github.com/ryanve/scan","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanve","download_url":"https://codeload.github.com/ryanve/scan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262038,"owners_count":21074236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","module","selector-engine"],"created_at":"2024-10-13T04:23:09.442Z","updated_at":"2025-10-16T12:24:09.555Z","avatar_url":"https://github.com/ryanve.png","language":"JavaScript","readme":"# scan\n#### standalone \u003ca href=\"#browser-support\"\u003e\u003ccode\u003equerySelectorAll\u003c/code\u003e\u003c/a\u003e selector engine with [jQuery](http://jquery.com)-like interface\n\n```sh\n$ npm install scan --save\n```\n\n### Basic usage\n\n```js\nvar scan = require('scan')\nscan('.example').find('a').not('[href^=\"#\"]')\n```\n\n## API ([0.9](../../releases))\n\n\u003cul\u003e\n\u003cli\u003e \u003ccode\u003escan()\u003c/code\u003e instances are array-like and inherit from \u003ccode\u003escan.prototype\u003c/code\u003e and \u003ccode\u003eArray.prototype\u003c/code\u003e\n\u003cli\u003e \u003ccode\u003escan()\u003c/code\u003e methods chain intuitively or are callable via \u003ccode\u003escan.prototype[method]\u003cwbr\u003e.call(array)\u003c/code\u003e\n\u003cli\u003e Methods are generally compatible with jQuery methods of the same name\n\u003c/ul\u003e\n\n### scan(query, context?)\n- `scan(selector)` \u0026rarr; elements that match \u003cvar\u003eselector\u003c/var\u003e\n- `scan(selector, node|nodes)` \u0026rarr; elements that match \u003cvar\u003eselector\u003c/var\u003e from \u003cvar\u003enode\u003c/var\u003e or any \u003cvar\u003enodes\u003c/var\u003e\n- `scan(node|nodes)` \u0026rarr; nodes wrapped in `scan` instance\n\n\u003ca name=\"scan.prototype.find\"\u003e\u003c/a\u003e\n### .find(needle)\n- `scan(query).find(selector)` \u0026rarr; descendants that match \u003cvar\u003eselector\u003c/var\u003e\n- `scan(query).find(element|elements)` \u0026rarr; elements that descend from \u003cvar\u003equery\u003c/var\u003e\n- `scan(stack).find(fn, scope?)` \u0026rarr; the first value to pass `fn.call(scope, value, i, stack)`\n\n\u003ca name=\"scan.prototype.filter\"\u003e\u003c/a\u003e\n### .filter(needle)\n- `scan(query).filter(nodes, selector)` \u0026rarr; stack filtered by \u003cvar\u003eselector\u003c/var\u003e\n- `scan(query).filter(fn)` \u0026rarr; stack filtered by `fn.call(element, i)`\n- `scan(query).filter(element|elements)` \u0026rarr; stack filtered by one or more elements\n- `scan(array).filter(values)` \u0026rarr; the intersection of 2 arrays\n\n\u003ca name=\"scan.prototype.not\"\u003e\u003c/a\u003e\n### .not(needle)\n- `scan(query).filter(selector)` \u0026rarr; `nodes` filtered *against* `selector`\n- `scan(query).not(fn)` \u0026rarr; stack filtered *against* `fn.call(element, i)`\n- `scan(query).not(element|elements)`\u0026rarr; stack filtered *against* one or more elements\n- `scan(array).not(values)` \u0026rarr; the difference of 2 arrays\n\n\u003ca name=\"scan.find\"\u003e\u003c/a\u003e\n### \u003cspan\u003e#\u003c/span\u003efind(needle)\n- `scan.find(selector, context?)` \u0026rarr; array of elements that match \u003cvar\u003eselector\u003c/var\u003e\n- `scan.find(stack, fn, scope?)` \u0026rarr; the first value to pass `fn.call(scope, value, i, stack)`\n\n\u003ca name=\"scan.matches\"\u003e\u003c/a\u003e\n### \u003cspan\u003e#\u003c/span\u003ematches(element, selector)\n- `scan.matches(element, selector)` \u0026rarr; `true` if \u003cvar\u003eelement\u003c/var\u003e matches \u003cvar\u003eselector\u003c/var\u003e\n\n\u003ca name=\"scan.contains\"\u003e\u003c/a\u003e\n### \u003cspan\u003e#\u003c/span\u003econtains(haystack, needle)\n- `scan.contains(node, element)` \u0026rarr; `true` if \u003cvar\u003enode\u003c/var\u003e contains \u003cvar\u003eelement\u003c/var\u003e\n- `scan.contains(stack, item, start=0)` \u0026rarr; `true` if \u003cvar\u003estack\u003c/var\u003e contains \u003cvar\u003eitem\u003c/var\u003e\n- `scan.contains(str, substr, start=0)` \u0026rarr; `true` if \u003cvar\u003estr\u003c/var\u003e contains \u003cvar\u003esubstr\u003c/var\u003e\n\n## \u003ca name=\"browser-support\"\u003e\u003c/a\u003eSupport\n\nSelector queries use [`querySelectorAll` where available](http://caniuse.com/#feat=queryselector) or else degrade to [`getElementsByTagName`](https://developer.mozilla.org/en-US/docs/Web/API/element.getElementsByTagName).\n\n- Lone tag selectors like `'p'` work in IE5.5+ and all other browsers\n- The universal selector `'*'` works in IE6+ and all other browsers\n- [CSS2+ selectors](http://www.w3.org/TR/CSS2/selector.html#pattern-matching) work in IE8+, FF3.5+, Opera 10+, and [all other browsers](http://caniuse.com/css-sel2)\n- [CSS3+ selectors](http://www.w3.org/TR/css3-selectors/#selectors) work in IE9+, FF3.5+, Opera 10+, and [all other browsers](http://caniuse.com/css-sel3)\n\n## Developers\n\n\u003cb\u003eContribute\u003c/b\u003e by making edits in [`/src`](./src) or reporting [issues](../../issues).\n\n```sh\n$ npm install\n$ grunt test\n```\n\n## Fund\n\u003cb\u003e[Tip the developer](https://www.gittip.com/ryanve/)\u003c/b\u003e =)\n\n## License\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanve%2Fscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanve%2Fscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanve%2Fscan/lists"}