{"id":14385186,"url":"https://github.com/npm-dom/domquery","last_synced_at":"2025-08-23T18:31:49.018Z","repository":{"id":8977014,"uuid":"10721320","full_name":"npm-dom/domquery","owner":"npm-dom","description":"jQuery-like handy DOM manipulation library composed from small modules in NPM.","archived":false,"fork":false,"pushed_at":"2016-04-09T04:18:54.000Z","size":67,"stargazers_count":86,"open_issues_count":5,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-21T10:02:40.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npm.im/domquery","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"expressjs/body-parser","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm-dom.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-06-16T14:46:17.000Z","updated_at":"2025-07-10T00:00:49.000Z","dependencies_parsed_at":"2022-09-18T07:23:07.579Z","dependency_job_id":null,"html_url":"https://github.com/npm-dom/domquery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/npm-dom/domquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-dom%2Fdomquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-dom%2Fdomquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-dom%2Fdomquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-dom%2Fdomquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm-dom","download_url":"https://codeload.github.com/npm-dom/domquery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-dom%2Fdomquery/sbom","scorecard":{"id":696211,"data":{"date":"2025-08-11","repo":{"name":"github.com/npm-dom/domquery","commit":"d158752ab4c4bff0dd34d24b34b913b94de72a9b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T03:46:52.065Z","repository_id":8977014,"created_at":"2025-08-22T03:46:52.066Z","updated_at":"2025-08-22T03:46:52.066Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271762973,"owners_count":24816843,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-28T18:02:01.082Z","updated_at":"2025-08-23T18:31:48.732Z","avatar_url":"https://github.com/npm-dom.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## DomQuery\n\njQuery-like handy DOM manipulation library composed from small modules.\n\nExample:\n\n```js\nvar dom = require('domquery')\n\ndom('ul.songs:last-child')\n  .add('\u003cli\u003e\u003ca href=\"/play/{id}\"\u003ePlay: {title}\u003c/a\u003e\u003c/li\u003e', { id: 123, title: \"foo\" })\n  .show()\n```\n\n## Install\n\n```bash\n$ npm install domquery\n```\n\n## Usage\n\nRecommended to use [browserify](http://github.com/substack/node-browserify) for bundling for client-side. Sorry, it does not work in Node.\n\n### Selecting\n\n```js\nvar dom = require('domquery')\n\ndom('body .foo .bar')\n// =\u003e [array, of, elements]\n\ndom('.foo', '.bar', '.qux').select('*')\n// [all children of .foo, .bar, .qux]\n\ndom('.foo', '.bar', '.qux').parent()\n// [parent elements of .foo, .bar, .qux]\n\ndom('.foo', '.bar', '.qux').siblings('button.tweet')\n// [all siblings that matches \"button.tweet\"]\n```\n\nDetails: [dom-select](https://github.com/npm-dom/dom-select), [siblings](http://github.com/npm-dom/siblings), [closest](https://github.com/component/closest)\n\n### Changing Style\n\n```js\nvar dom = require('domquery')\n\ndom('body .foo .bar')\n  .style('background-color', 'red')\n  // OR\n  .style({\n    'padding': '10px',\n    'margin': '10px'\n  })\n```\n\nOther available Methods:\n* show\n* hide\n\nDetails: [dom-style](https://github.com/npm-dom/dom-style)\n\n### Adding and Removing Elements\n\ndomquery embeds [dom-tree](http://github.com/npm-dom) to provide following methods;\n\n#### .insert(parent element)\n\nInsert an element to a parent element.\n\n```js\nvar dom = require('domquery')\n\ndom('\u003ch1\u003e{title}\u003c/h1\u003e\u003cdiv\u003e{content}', { title: 'Hello!', content: 'world' })\n  .insert('body')\n```\n\n#### .add(child)\n\nAdd a new element to specified parent element.\n\n```js\ndom('body \u003e ul')\n  .add('\u003cli\u003eHello\u003c/li\u003e')\n```\n\nOr;\n\n```js\nvar row = dom('\u003cli\u003e{0}: {1}\u003c/li\u003e', 123, 'Hello World')\ndom('body \u003e ul').add(row)\n```\n\n* `child` can be an element, array, selector or HTML.\n\n#### .addBefore(child, reference)\n\nAdds `child` before `reference`\n\n```js\ndom('ul.songs')\n  .addBefore('\u003cli\u003ethird song\u003c/li\u003e', 'ul.songs li:nth-child(3)')\n```\n\n* `child` can be an element, array, selector or HTML.\n* `reference` can be an element, array or selector.\n\n#### .addAfter(child, reference)\n\nAdds `child` after `reference`\n\n```js\ndom('ul.songs')\n  .addAfter('\u003cli\u003ethird song\u003c/li\u003e', 'ul.songs li:nth-child(2)')\n```\n\n* `child` can be an element, array, selector or HTML.\n* `reference` can be an element, array or selector.\n\n#### .replace(target, replacement)\n\nReplaces `target` with `replacement`\n\n```js\ndom('ul.songs')\n  .replace('li:first-child', document.createElement('textarea'))\n```\n\nor:\n\n```js\ndom('ul.songs')\n  .replace('li:first-child', '\u003cli\u003e{0}: {name}\u003c/li\u003e', 123, 'new song')\n```\n\n#### .remove(element)\n\n```js\ndom('ul .songs').remove('li:first-child')\n```\n\n### Inline CSS\n\nMethods: addClass, hasClass, removeClass, toggleClass\n\nExample:\n```js\nvar dom = require('domquery')\n\ndom('body').addClass('foobar')\n\ndom('body').hasClass('foobar')\n// =\u003e true\n\ndom('body').removeClass('foobar')\n\ndom('body').hasClass('foobar')\n// =\u003e false\n\ndom('body').toggleClass('foobar')\n\ndom('body').hasClass('foobar')\n// =\u003e true\n```\n\nOther Available Methods:\n* addClass\n* hasClass\n* removeClass\n* toggleClass\n\nDetails: [dom-classes](https://github.com/npm-dom/dom-classes)\n\n### Events\n\ndomquery embeds [dom-event](http://github.com/npm-dom/dom-event), [key-event](http://github.com/npm-dom/key-event) and [delegate-dom](http://github.com/npm-dom/delegate-dom) modules to provide following methods;\n\n#### .on(event, callback)\n\nAdd a new event\n\n```js\nvar dom = require('domquery')\n\ndom('body').on('click', function (event) {\n  console.log('clicked body')\n})\n```\n\nShortcuts:\n\n```js\ndom('ul li').click(function (event) {\n  console.log('clicked a \"li\"')\n})\n```\n\n* change\n* click\n* keydown\n* keyup\n* keypress\n* mousedown\n* mouseover\n* mouseup\n* resize\n\n##### .off(event, callback)\n\nRemove the event listener;\n\n```js\ndom('body').off('click', fn)\n```\n\n#### .on(event, selector, callback)\n\n[Delegate event](http://github.com/npm-dom/delegate-dom) handler function for `selector`:\n\n```js\ndom('body ul').on('click', 'li', function (event) {\n  console.log('clicked a list item!')\n})\n```\n\n#### .onKey(event, callback)\n\nAdds a [keyboard event](http://github.com/npm-dom/key-event):\n\n```js\ndom('input').onKey('alt a', function (event) {\n  console.log('user pressed alt + a')\n})\n```\n\n\n#### .offKey(event, callback)\n\nRemoves a [keyboard event](http://github.com/npm-dom/key-event):\n\n```js\ndom('input').onKey('alt a', altA)\ndom('input').offKey('alt a', altA)\n\nfunction altA (event) {\n  console.log('user pressed alt + a')\n}\n```\n\n### Attributes\n\n```js\nvar dom = require('domquery')\n\ndom('a.my-link').attr('href')\n// =\u003e http://foobar.com\n\ndom('a').attr('href', 'http://foobar.com')\n```\n\n### Content\n\nReading:\n\n```js\ndom('.foo').html() // equivalent of `innerHTML`\ndom('input.my-input').val() // equivalent of `value`\n```\n\nSetting:\n\n```js\ndom('.foo').html('\u003cdiv\u003enew content\u003c/div\u003e')\ndom('input.my-input').val('new value')\n```\n\nMore info about it is at [dom-value](http://github.com/npm-dom/dom-value)\n\n![](https://dl.dropboxusercontent.com/s/ofqr0ha1all2nbl/npmel_30.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm-dom%2Fdomquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm-dom%2Fdomquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm-dom%2Fdomquery/lists"}