{"id":20812200,"url":"https://github.com/BansheeTech/AgnosticWipe","last_synced_at":"2025-05-11T20:30:26.165Z","repository":{"id":257822300,"uuid":"870914326","full_name":"BansheeTech/AgnosticWipe","owner":"BansheeTech","description":"AgnosticWipe is a utility function that safely removes all child nodes of a given DOM element, avoiding the use of innerHTML to clear content. It includes configurable debugging capabilities (log and warn), similar to other Agnostic modules, to assist with troubleshooting during development.","archived":false,"fork":false,"pushed_at":"2024-10-10T22:44:39.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T10:32:42.884Z","etag":null,"topics":["agnostic-wipe","agnosticwipe","clean","dom","dom-manipulation","firstchild","innerhtml","javascript","removechild","security","targetselector","vanilla-javascript","vanilla-js","wipe","xss"],"latest_commit_sha":null,"homepage":"https://github.com/BansheeDevelopment/AgnosticWipe","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/BansheeTech.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-10T22:42:57.000Z","updated_at":"2025-04-16T07:11:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"241bade2-c83e-44ac-b0cb-0682b53438f7","html_url":"https://github.com/BansheeTech/AgnosticWipe","commit_stats":null,"previous_names":["bansheedevelopment/agnosticwipe","banshee-technologies/agnosticwipe","bansheetech/agnosticwipe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BansheeTech%2FAgnosticWipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BansheeTech%2FAgnosticWipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BansheeTech%2FAgnosticWipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BansheeTech%2FAgnosticWipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BansheeTech","download_url":"https://codeload.github.com/BansheeTech/AgnosticWipe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253631817,"owners_count":21939358,"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":["agnostic-wipe","agnosticwipe","clean","dom","dom-manipulation","firstchild","innerhtml","javascript","removechild","security","targetselector","vanilla-javascript","vanilla-js","wipe","xss"],"created_at":"2024-11-17T20:51:09.984Z","updated_at":"2025-05-11T20:30:25.735Z","avatar_url":"https://github.com/BansheeTech.png","language":"JavaScript","readme":"\n# AgnosticWipe\n\nAgnosticWipe is a utility function that safely removes all child nodes of a given DOM element, avoiding the use of `innerHTML` to clear content. It includes configurable debugging capabilities (`log` and `warn`), similar to other Agnostic modules, to assist with troubleshooting during development.\n\n## Features\n\n- Safely wipes the content of a DOM element without using `innerHTML`.\n- Configurable debugging for logging and warnings.\n- Simple, clean, and secure DOM manipulation.\n\n## Installation\n\nYou can install AgnosticWipe via npm:\n\n```bash\nnpm install agnostic-wipe\n```\n\n## Usage\n\n### Importing and Declaring Debugging\n\nTo use `agnosticWipe`, first import it and configure the debugging options globally. You can then wipe the content of elements without needing to reconfigure debugging for every call.\n\n```javascript\nimport { agnosticWipe } from 'agnostic-wipe';\n\n// Configure AgnosticWipe with debug options globally\nwindow.agnosticWipe = agnosticWipe({ debugLog: true, debugWarn: true });\n```\n\n### Basic Usage\n\nOnce `agnosticWipe` is configured globally, you can call it directly to wipe the content of any element by providing the target selector:\n\n```javascript\n// Wipe content of an element with the ID '#myElement'\nwindow.agnosticWipe('#myElement');\n```\n\nThis will safely remove all the child nodes of the selected element.\n\n### Direct Usage Without Debugging\n\nIf you don't need to configure debugging, you can use `agnosticWipe` without setting the options:\n\n```javascript\n// Wipe content of an element without configuring debugging\nagnosticWipe()('#myElement');\n```\n\n### Debugging\n\nThe `agnosticWipe` function can be configured to show logs and warnings:\n\n- `debugLog`: Controls the appearance of informational messages (`console.log`). It can be set to `true` or `false`.\n- `debugWarn`: Controls the appearance of warning messages (`console.warn`). It can be set to `true` or `false`.\n\nBy default, both flags are set to `false`.\n\n#### Example:\n\nShow only warnings in the console:\n```javascript\nwindow.agnosticWipe = agnosticWipe({ debugLog: false, debugWarn: true });\n```\n\nShow both logs and warnings:\n```javascript\nwindow.agnosticWipe = agnosticWipe({ debugLog: true, debugWarn: true });\n```\n\nShow nothing:\n```javascript\nwindow.agnosticWipe = agnosticWipe;\n```\n-or-\n```javascript\nwindow.agnosticWipe = agnosticWipe({ debugLog: false, debugWarn: false });\n```\n\n## License\n\nAgnosticHTML is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Issues\n\nIf you encounter any issues, feel free to report them [here](https://github.com/BansheeDevelopment/AgnosticWipe/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBansheeTech%2FAgnosticWipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBansheeTech%2FAgnosticWipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBansheeTech%2FAgnosticWipe/lists"}