{"id":15814267,"url":"https://github.com/stevenvachon/assign-dom-doctype","last_synced_at":"2026-05-17T17:43:31.659Z","repository":{"id":66016686,"uuid":"221075822","full_name":"stevenvachon/assign-dom-doctype","owner":"stevenvachon","description":"Insert, replace or remove a DocumentType node within a Document.","archived":false,"fork":false,"pushed_at":"2019-11-22T23:36:44.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T00:37:27.771Z","etag":null,"topics":["doctype","document","document-type","dom","node"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-11T21:44:58.000Z","updated_at":"2021-10-20T19:10:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"6989a0ac-f737-4378-8ec5-8b73b76afcd0","html_url":"https://github.com/stevenvachon/assign-dom-doctype","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevenvachon/assign-dom-doctype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fassign-dom-doctype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fassign-dom-doctype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fassign-dom-doctype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fassign-dom-doctype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenvachon","download_url":"https://codeload.github.com/stevenvachon/assign-dom-doctype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fassign-dom-doctype/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266499307,"owners_count":23938832,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["doctype","document","document-type","dom","node"],"created_at":"2024-10-05T04:23:58.431Z","updated_at":"2026-05-17T17:43:31.608Z","avatar_url":"https://github.com/stevenvachon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assign-dom-doctype [![NPM Version][npm-image]][npm-url] ![File Size][filesize-image] ![Build Status][ci-image] [![Coverage Status][coveralls-image]][coveralls-url]\n\n\u003e Insert, replace or remove a [`DocumentType` node](https://mdn.io/DocumentType) within a [`Document`](https://mdn.io/Document).\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 assign-dom-doctype\n```\n\n\n## Importing\n\nES Module:\n```js\nimport assignDoctype from 'assign-dom-doctype';\n```\n\nCommonJS Module:\n```js\nconst assignDoctype = require('assign-dom-doctype');\n```\n\n\n## Usage\nInsert or replace:\n```js\nconst newDoctype = document.implementation.createDocumentType('qualifiedNameStr', 'publicId', 'systemId');\n\nassignDoctype(newDoctype, document);\n````\n\nRemove:\n```js\nassignDoctype(null, document);\n```\n\nThe `Document`'s previous [`doctype`](https://mdn.io/Document/doctype) value will be returned.\n\n\n## Compatibility\n\nDepending on your target browsers, you may need polyfills/shims for the following:\n\n* [`Node::before`](https://mdn.io/Node/before)\n* [`Node::remove`](https://mdn.io/Node/remove)\n* [`Node::replaceWith`](https://mdn.io/Node/replaceWith)\n\n\n[npm-image]: https://img.shields.io/npm/v/assign-dom-doctype.svg\n[npm-url]: https://npmjs.com/package/assign-dom-doctype\n[filesize-image]: https://img.shields.io/badge/size-540B%20gzipped-blue.svg\n[ci-image]: https://github.com/stevenvachon/assign-dom-doctype/workflows/tests/badge.svg\n[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/assign-dom-doctype.svg\n[coveralls-url]: https://coveralls.io/github/stevenvachon/assign-dom-doctype\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fassign-dom-doctype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenvachon%2Fassign-dom-doctype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fassign-dom-doctype/lists"}