{"id":15814116,"url":"https://github.com/stevenvachon/replace-dom-string","last_synced_at":"2025-10-19T04:50:10.163Z","repository":{"id":57353693,"uuid":"184302293","full_name":"stevenvachon/replace-dom-string","owner":"stevenvachon","description":"Replace one or more strings/regexes within a DOM tree.","archived":false,"fork":false,"pushed_at":"2019-05-19T21:04:32.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T13:57:50.725Z","etag":null,"topics":["dom","replace","traverse","walk"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevenvachon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-30T17:15:22.000Z","updated_at":"2019-05-19T21:04:33.000Z","dependencies_parsed_at":"2022-09-19T00:40:56.183Z","dependency_job_id":null,"html_url":"https://github.com/stevenvachon/replace-dom-string","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevenvachon/replace-dom-string","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Freplace-dom-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Freplace-dom-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Freplace-dom-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Freplace-dom-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenvachon","download_url":"https://codeload.github.com/stevenvachon/replace-dom-string/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Freplace-dom-string/sbom","scorecard":{"id":852722,"data":{"date":"2025-08-11","repo":{"name":"github.com/stevenvachon/replace-dom-string","commit":"519383aa0f7e334d5e25eff125f26d5018fc26bf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/2 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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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-23T22:56:53.950Z","repository_id":57353693,"created_at":"2025-08-23T22:56:53.950Z","updated_at":"2025-08-23T22:56:53.950Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279699577,"owners_count":26212749,"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-10-19T02:00:07.647Z","response_time":64,"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":["dom","replace","traverse","walk"],"created_at":"2024-10-05T04:22:39.746Z","updated_at":"2025-10-19T04:50:10.128Z","avatar_url":"https://github.com/stevenvachon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# replace-dom-string [![NPM Version][npm-image]][npm-url] ![File Size][filesize-image] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url]\n\n\u003e Replace one or more matching strings/regexes within a DOM tree.\n\n\n## Installation\n\n[Node.js](http://nodejs.org/) `\u003e= 10` is required. To install, type this at the command line:\n```shell\nnpm install replace-dom-string\n```\n\n\n## Usage\n\nImport as an ES Module:\n```js\nimport replaceDOMString from 'replace-dom-string';\n```\n\nImport as a CommonJS Module:\n```js\nconst replaceDOMString = require('replace-dom-string');\n```\n\nSingle needle/replacement with default options:\n```js\nconst target = document.querySelector('elm');\n// \u003celm attr=\"needle\"\u003eneedle\u003c/elm\u003e\n\nreplaceDOMString('needle', 'replacement', target);\n// \u003celm attr=\"replacement\"\u003ereplacement\u003c/elm\u003e\n```\n\nSingle needle/replacement with custom options:\n```js\nconst target = document.querySelector('elm');\n// \u003celm attr=\"needle\"\u003eneedle\u003c/elm\u003e\n\nreplaceDOMString('needle', 'replacement', target, {characterData: false});\n// \u003celm attr=\"replacement\"\u003eneedle\u003c/elm\u003e\n```\n\nMultiple needles/replacements (including `RegExp`) and custom options:\n```js\nconst target = document.querySelector('elm');\n/*\n\u003celm attr=\"foo bar001\"\u003e\n  foo bar001\n  \u003cnested attr=\"foo bar001\"\u003efoo bar001\u003c/nested\u003e\n\u003c/elm\u003e\n*/\n\nreplaceDOMString(\n  ['foo', /bar(\\d+)/g],\n  ['baz', 'baz$1'],\n  target,\n  {attributes: false}\n);\n/*\n\u003celm attr=\"foo bar001\"\u003e\n  baz baz001\n  \u003cnested attr=\"foo bar001\"\u003ebaz baz001\u003c/nested\u003e\n\u003c/elm\u003e\n*/\n```\n\n\n## Options\n\nAt a minimum, one of `attributes` and/or `characterData` must be `true`; otherwise, a `TypeError` exception will be thrown. Inspired by [`MutationObserver`](https://mdn.io/MutationObserver).\n\n### `acceptAttribute`\nType: `Function`  \nDefault value: `(attribute) =\u003e true`  \nA custom filter that is performed for each attribute after the default filtering has deemed such worthy of changes. It must return a boolean.\n\n### `acceptNode`\nType: `Function`  \nDefault value: `(node) =\u003e NodeFilter.FILTER_ACCEPT`  \nA custom filter that is performed for each `ELEMENT_NODE` and `TEXT_NODE` after the default filtering has deemed such worthy of changes. It must return a [`NodeFilter.FILTER_*` constant](https://mdn.io/NodeFilter).\n\n### `attributes`\nType: `Boolean`  \nDefault value: `true`  \nWhen `true`, attribute *values* will be included in substitution.\n\n### `characterData`\nType: `Boolean`  \nDefault value: `true`  \nWhen `true`, [`Text` nodes](https://mdn.io/Text) within the child list of `target` will be included in substitution.\n\n### `subtree`\nType: `Boolean`  \nDefault value: `true`  \nWhen `true`, substitution will be extended to the entire subtree of nodes rooted at `target`.\n\n\n## Compatibility\n\nDepending on your target browsers, you may need polyfills/shims for the following:\n\n* [`Array.from`](https://mdn.io/Array.from)\n* [`Array::includes`](https://mdn.io/Array::includes)\n\n\n[npm-image]: https://img.shields.io/npm/v/replace-dom-string.svg\n[npm-url]: https://npmjs.com/package/replace-dom-string\n[filesize-image]: https://img.shields.io/badge/size-1.8kB%20gzipped-blue.svg\n[travis-image]: https://img.shields.io/travis/stevenvachon/replace-dom-string.svg\n[travis-url]: https://travis-ci.org/stevenvachon/replace-dom-string\n[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/replace-dom-string.svg\n[coveralls-url]: https://coveralls.io/github/stevenvachon/replace-dom-string\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Freplace-dom-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenvachon%2Freplace-dom-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Freplace-dom-string/lists"}