{"id":15931833,"url":"https://github.com/victornpb/querycomments","last_synced_at":"2025-03-24T18:32:34.799Z","repository":{"id":57332355,"uuid":"96484560","full_name":"victornpb/querycomments","owner":"victornpb","description":"querySelector like but for selecting HTML Comments like any other DOM Node","archived":false,"fork":false,"pushed_at":"2024-07-24T18:09:15.000Z","size":205,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T12:51:20.619Z","etag":null,"topics":["dom-node","getcomments","javascript","javascript-library","npm-package","regex-pattern","selector-engine"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victornpb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://www.buymeacoffee.com/vitim"],"github":null,"patreon":null,"open_collective":null,"ko_fi":"victornpb","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null}},"created_at":"2017-07-07T00:58:08.000Z","updated_at":"2024-07-24T18:09:18.000Z","dependencies_parsed_at":"2024-07-24T20:52:35.578Z","dependency_job_id":null,"html_url":"https://github.com/victornpb/querycomments","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.4285714285714286,"last_synced_commit":"3331562671f28d97f46eb4ca12ed41fec7c79e38"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2Fquerycomments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2Fquerycomments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2Fquerycomments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2Fquerycomments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victornpb","download_url":"https://codeload.github.com/victornpb/querycomments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245328412,"owners_count":20597419,"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":["dom-node","getcomments","javascript","javascript-library","npm-package","regex-pattern","selector-engine"],"created_at":"2024-10-07T01:40:30.177Z","updated_at":"2025-03-24T18:32:34.490Z","avatar_url":"https://github.com/victornpb.png","language":"JavaScript","readme":"# queryComments.js\n\n![Node](https://img.shields.io/node/v/querycomments.svg?style=flat-square)\n[![NPM](https://img.shields.io/npm/v/querycomments.svg?style=flat-square)](https://www.npmjs.com/package/querycomments)\n[![NPM](https://img.shields.io/npm/dt/querycomments.svg?style=flat-square)](https://www.npmjs.com/package/querycomments)\n\nSelect HTML Comments like any other DOM Node, with this fast comment selector implementation.\n\n## Installation\n\n[Yarn](https://github.com/yarnpkg/yarn)\n\n    yarn add querycomments\n\nNPM\n\n    npm install querycomments\n\nIf you don't use a package manager, you can [access `querycomments` via unpkg (CDN)](https://unpkg.com/querycomments/), download the source, or point your package manager to the url.\n\n\n\n```html\n\u003c!-- This is a comment --\u003e\n```\n\nJSFiddle Example [DEMO](https://jsfiddle.net/Victornpb/630garm8/)\n\n## API\n\n```ts\ngetComments(context:DOMNode, filter:function|RegExp):Array\n```\n\n## Examples\n\nget all comments\n\n```js\ngetComments();\n```\n\nget all comments inside a element\n\n```js\ngetComments(document.getElementById('someDiv'));\n```\n\nget the first comment that match a regex pattern\n\n```js\ngetComments(document, /hey/i);\n```\n\nget the first comment is filtered by a function\n\n```js\ngetComments(document, (text, comment) =\u003e {\n  this.breakOnFirst = true; //I only need the first comment\n  return text.substring(0, 4) === 'Lorem'; //does it starts with \"Lorem\"\n});\n```\n\nget All comments that match a regex pattern\n\n```js\ngetComments(document, /foo/g); // notice the global flag on the regex\n```\n\nget all comments filtered by a function\n\n```js\ngetComments(document, (text, comment) =\u003e {\n  const possibleValues = ['foo', 'bar', 'baz'];\n\n  for (var i = 0; i \u003c possibleValues.length; i++) {\n    if (text.indexOf(possibleValues[i]) \u003e -1) return true;\n  }\n  return false;\n});\n```\n\n## Suggestions / Questions\n\nFile a [issue](https://github.com/victornpb/getComments.js/issues) on this repository\n","funding_links":["https://www.buymeacoffee.com/vitim","https://ko-fi.com/victornpb"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictornpb%2Fquerycomments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictornpb%2Fquerycomments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictornpb%2Fquerycomments/lists"}