{"id":15598757,"url":"https://github.com/lukechilds/create-node","last_synced_at":"2025-04-28T11:24:27.973Z","repository":{"id":66309103,"uuid":"59421475","full_name":"lukechilds/create-node","owner":"lukechilds","description":"Converts an HTML string to a dom node","archived":false,"fork":false,"pushed_at":"2019-10-10T23:35:25.000Z","size":38,"stargazers_count":7,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T11:24:21.594Z","etag":null,"topics":["dom","dom-manipulation","dom-node","templating"],"latest_commit_sha":null,"homepage":null,"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/lukechilds.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":"2016-05-22T16:08:48.000Z","updated_at":"2023-09-08T17:10:41.000Z","dependencies_parsed_at":"2023-03-10T23:48:35.553Z","dependency_job_id":null,"html_url":"https://github.com/lukechilds/create-node","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.13559322033898302","last_synced_commit":"bd0f285221b6d635188a8359f90cb2c25bc728dc"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukechilds","download_url":"https://codeload.github.com/lukechilds/create-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251303427,"owners_count":21567693,"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","dom-manipulation","dom-node","templating"],"created_at":"2024-10-03T01:41:13.827Z","updated_at":"2025-04-28T11:24:27.946Z","avatar_url":"https://github.com/lukechilds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# create-node\n\nConverts an HTML string to a DOM node.\n\n[![Build Status](https://travis-ci.org/lukechilds/create-node.svg?branch=master)](https://travis-ci.org/lukechilds/create-node)\n[![Coverage Status](https://coveralls.io/repos/github/lukechilds/create-node/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/create-node?branch=master)\n[![npm](https://img.shields.io/npm/v/create-node.svg)](https://www.npmjs.com/package/create-node)\n\n## Install\n\n```shell\nnpm install --save create-node\n```\n\nor\n\n```shell\njspm install create-node\n```\n\n## Usage\n\nPassing in markup with one top level element will return an `HTMLElement` (or something that inherits from it e.g `HTMLDivElement`)\n\n```js\nimport createNode from 'create-node';\n\nconst markup = `\n\u003cdiv\u003e\n  \u003cspan\u003ehello\u003c/span\u003e\n  \u003cspan\u003eworld\u003c/span\u003e\n\u003c/div\u003e`;\n\nconst node = createNode(markup);\n// HTMLDivElement\n\nnode.querySelector('span:first-child').textContent;\n// 'hello'\n\ndocument.body.appendChild(node);\n```\n\nPassing in markup with multiple top level elements will return an `HTMLCollection` of `HTMLElement`s.\n\n```js\nimport createNode from 'create-node';\n\nconst markup = `\n\u003cspan\u003ehello\u003c/span\u003e\n\u003cspan\u003eworld\u003c/span\u003e`;\n\nconst collection = createNode(markup);\n// HTMLCollection\n\ncollection[1].textContent;\n// 'world'\n```\n\n## License\n\nMIT © Luke Childs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fcreate-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukechilds%2Fcreate-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fcreate-node/lists"}