{"id":18186454,"url":"https://github.com/dna-engine/dna-engine","last_synced_at":"2025-04-08T04:15:40.297Z","repository":{"id":7705724,"uuid":"9070439","full_name":"dna-engine/dna-engine","owner":"dna-engine","description":"🧬 An uncomplicated user interface library for cloning semantic templates (with TypeScript declarations)","archived":false,"fork":false,"pushed_at":"2025-03-31T09:42:31.000Z","size":4979,"stargazers_count":125,"open_issues_count":1,"forks_count":44,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-01T03:35:44.260Z","etag":null,"topics":["clone","dom","html","jamstack","javascript","json-data","template-engine","typescript","ui"],"latest_commit_sha":null,"homepage":"https://dna-engine.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-engine.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}},"created_at":"2013-03-28T05:03:59.000Z","updated_at":"2025-03-31T09:42:10.000Z","dependencies_parsed_at":"2023-02-19T14:45:27.889Z","dependency_job_id":"d021c2e3-37ed-4936-bd90-c04e24c599c5","html_url":"https://github.com/dna-engine/dna-engine","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":139,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-engine%2Fdna-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-engine%2Fdna-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-engine%2Fdna-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dna-engine%2Fdna-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dna-engine","download_url":"https://codeload.github.com/dna-engine/dna-engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993639,"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":["clone","dom","html","jamstack","javascript","json-data","template-engine","typescript","ui"],"created_at":"2024-11-03T00:03:02.631Z","updated_at":"2025-04-08T04:15:40.279Z","avatar_url":"https://github.com/dna-engine.png","language":"TypeScript","readme":"# dna-engine\n\u003cimg src=https://dna-engine.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-engine.org/license)\n[![npm](https://img.shields.io/npm/v/dna-engine.svg)](https://www.npmjs.com/package/dna-engine)\n[![Hits](https://data.jsdelivr.com/v1/package/npm/dna-engine/badge?style=rounded)](https://www.jsdelivr.com/package/npm/dna-engine)\n[![Build](https://github.com/dna-engine/dna-engine/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/dna-engine/dna-engine/actions/workflows/run-spec-on-push.yaml)\n\ndna-engine is a lightweight easy-to-use UI library enabling developers to rapidly build maintainable\nJavaScript applications.\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```js\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-engine.org](https://dna-engine.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-engine](https://youtu.be/1CrYAFZPdAg) (YouTube)\n* [Documentation](https://dna-engine.org/docs)\n* [Release Notes](https://github.com/dna-engine/dna-engine/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-engine/dna-engine/issues](https://github.com/dna-engine/dna-engine/issues)\n\ndna-engine is open source under the [MIT License](https://dna-engine.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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdna-engine%2Fdna-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdna-engine%2Fdna-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdna-engine%2Fdna-engine/lists"}