{"id":49153224,"url":"https://github.com/dna-dom/dna-dom","last_synced_at":"2026-04-22T07:06:42.361Z","repository":{"id":7705724,"uuid":"9070439","full_name":"dna-dom/dna-dom","owner":"dna-dom","description":"🧬 An uncomplicated user interface library for cloning semantic templates (with TypeScript declarations)","archived":false,"fork":false,"pushed_at":"2026-03-03T05:53:59.000Z","size":5698,"stargazers_count":126,"open_issues_count":3,"forks_count":43,"subscribers_count":12,"default_branch":"main","last_synced_at":"2026-04-01T07:57:37.546Z","etag":null,"topics":["clone","dom","html","jamstack","javascript","json-data","template-engine","typescript","ui"],"latest_commit_sha":null,"homepage":"https://dna-dom.org","language":"TypeScript","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/dna-dom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-03-28T05:03:59.000Z","updated_at":"2026-03-03T05:54:03.000Z","dependencies_parsed_at":"2026-02-25T06:03:26.809Z","dependency_job_id":null,"html_url":"https://github.com/dna-dom/dna-dom","commit_stats":{"total_commits":1317,"total_committers":48,"mean_commits":27.4375,"dds":0.3151100987091876,"last_synced_commit":"acb98a140fb9aad4a4cf082b50c439e09381d26e"},"previous_names":["dnajs/dna.js"],"tags_count":146,"template":false,"template_full_name":null,"purl":"pkg:github/dna-dom/dna-dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-dom%2Fdna-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-dom%2Fdna-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-dom%2Fdna-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-dom%2Fdna-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dna-dom","download_url":"https://codeload.github.com/dna-dom/dna-dom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-dom%2Fdna-dom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32125101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"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":["clone","dom","html","jamstack","javascript","json-data","template-engine","typescript","ui"],"created_at":"2026-04-22T07:06:28.679Z","updated_at":"2026-04-22T07:06:42.352Z","avatar_url":"https://github.com/dna-dom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dna-dom\n\u003cimg src=https://dna-dom.org/graphics/dna-logo.png align=right width=160 alt=logo\u003e\n\n_An uncomplicated user interface library for cloning semantic templates_\n\n[![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://dna-dom.org/license)\n[![npm](https://img.shields.io/npm/v/dna-dom.svg)](https://www.npmjs.com/package/dna-dom)\n[![Hits](https://data.jsdelivr.com/v1/package/npm/dna-dom/badge?style=rounded)](https://www.jsdelivr.com/package/npm/dna-dom)\n[![Build](https://github.com/dna-dom/dna-dom/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/dna-dom/dna-dom/actions/workflows/run-spec-on-push.yaml)\n[![Publish Website](https://github.com/dna-dom/dna-dom/actions/workflows/publish-website.yaml/badge.svg)](https://github.com/dna-dom/dna-dom/actions/workflows/publish-website.yaml)\n\ndna-dom is a lightweight easy-to-use UI library enabling developers to rapidly build maintainable\nJavaScript applications.\u0026nbsp;\nThe project name stems from its primary function of cloning DOM templates.\u0026nbsp;\n\n## A) Bookstore Example\nDesignate templates with the `dna-template` class, and put the templates directly into the HTML\nof your web page.\u0026nbsp;\nUse the element's `id` to indicate the name of the template.\u0026nbsp;\nEnclose data fields in double tildes `~~`.\n\n### 1. HTML for book template\n```html\n\u003ch1\u003eFeatured Books\u003c/h1\u003e\n\u003csection class=books\u003e\n   \u003cdiv id=book class=dna-template\u003e\n      \u003ch2\u003e~~title~~\u003c/h2\u003e\n      Author: \u003ccite\u003e~~author~~\u003c/cite\u003e\n   \u003c/div\u003e\n\u003c/section\u003e\n```\n\nThen call the `dna.clone()` function to insert a copy of the template into the DOM.\u0026nbsp;\nThe supplied JSON data object populates the fields of the template.\n\n### 2. JavaScript call to add book node\n```javascript\ndna.clone('book', { title: 'The DOM', author: 'Jan' });\n```\n\nThe new clone element replaces the template.\u0026nbsp;\nThe original template is detached from the DOM and kept for additional cloning.\n\n### 3. Resulting HTML with clone\n```html\n\u003ch1\u003eFeatured Books\u003c/h1\u003e\n\u003csection class=books\u003e\n   \u003cdiv class=book\u003e\n      \u003ch2\u003eThe DOM\u003c/h2\u003e\n      Author: \u003ccite\u003eJan\u003c/cite\u003e\n   \u003c/div\u003e\n\u003c/section\u003e\n```\n\nNeed to clone the template multiple times?\u0026nbsp;\nSimply pass an array of data objects into the `dna.clone()` function.\n\n## B) Additional Information\n* [https://dna-dom.org](https://dna-dom.org/) (see the *\"Try it out\"* section for an interactive example)\n* [Sample To-Do Application](https://jsfiddle.net/4jkua81f) (jsfiddle)\n* [Introduction to dna-dom](https://youtu.be/1CrYAFZPdAg) (YouTube)\n* [Documentation](https://dna-dom.org/docs)\n* [Release Notes](https://github.com/dna-dom/dna-dom/wiki/Release-Notes)\n\n## C) Contributor Notes\nTo be a contributor, **fork** the project and run the commands `npm install` and `npm test` on your\nlocal clone.\u0026nbsp;\nMake your edits and rerun the tests.\n\nPull requests welcome.\u0026nbsp;\nSince the pacakge version number is updated during the release process, you can leave the version number unchanged.\n\n## D) Build Environment\nCheck out the `runScriptsConfig` section in [package.json](package.json) for an\ninteresting approach to organizing build tasks.\n\n**CLI Build Tools for package.json**\n   - 🎋 [add-dist-header](https://github.com/center-key/add-dist-header):\u0026nbsp; _Prepend a one-line banner comment (with license notice) to distribution files_\n   - 📄 [copy-file-util](https://github.com/center-key/copy-file-util):\u0026nbsp; _Copy or rename a file with optional package version number_\n   - 📂 [copy-folder-util](https://github.com/center-key/copy-folder-util):\u0026nbsp; _Recursively copy files from one folder to another folder_\n   - 🪺 [recursive-exec](https://github.com/center-key/recursive-exec):\u0026nbsp; _Run a command on each file in a folder and its subfolders_\n   - 🔍 [replacer-util](https://github.com/center-key/replacer-util):\u0026nbsp; _Find and replace strings or template outputs in text files_\n   - 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):\u0026nbsp; _Revision web asset filenames with cache busting content hash fingerprints_\n   - 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):\u0026nbsp; _Organize npm package.json scripts into groups of easy to manage commands_\n   - 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator):\u0026nbsp; _Check the markup validity of HTML files using the W3C validator_\n\n\u003cbr\u003e\n\n---\nFeel free to submit questions at:\u003cbr\u003e\n[github.com/dna-dom/dna-dom/issues](https://github.com/dna-dom/dna-dom/issues)\n\ndna-dom is open source under the [MIT License](https://dna-dom.org/license).\u0026nbsp;\nThe website and documentation are published under the\n[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdna-dom%2Fdna-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdna-dom%2Fdna-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdna-dom%2Fdna-dom/lists"}