{"id":17382187,"url":"https://github.com/strd6/jadelet","last_synced_at":"2025-04-04T13:10:09.127Z","repository":{"id":16797788,"uuid":"19556488","full_name":"STRd6/jadelet","owner":"STRd6","description":"Pure and simple clientside templates","archived":false,"fork":false,"pushed_at":"2024-07-28T17:17:38.000Z","size":657,"stargazers_count":378,"open_issues_count":8,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-03T23:44:29.403Z","etag":null,"topics":["clientside-templates","coffeescript","html","jadelet","javascript","nodejs","reactive-templates","template"],"latest_commit_sha":null,"homepage":"https://jadelet.com","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/STRd6.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-05-08T01:28:07.000Z","updated_at":"2025-03-10T06:59:00.000Z","dependencies_parsed_at":"2024-06-21T15:35:46.445Z","dependency_job_id":"125a68ef-fb7b-4862-9235-23cd1bb2d717","html_url":"https://github.com/STRd6/jadelet","commit_stats":{"total_commits":176,"total_committers":6,"mean_commits":"29.333333333333332","dds":0.5340909090909092,"last_synced_commit":"00437527023b4d0ab15c24a4a8383b955f381478"},"previous_names":["dr-coffee-labs/hamlet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STRd6%2Fjadelet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STRd6%2Fjadelet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STRd6%2Fjadelet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STRd6%2Fjadelet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STRd6","download_url":"https://codeload.github.com/STRd6/jadelet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182399,"owners_count":20897381,"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":["clientside-templates","coffeescript","html","jadelet","javascript","nodejs","reactive-templates","template"],"created_at":"2024-10-16T07:35:45.472Z","updated_at":"2025-04-04T13:10:09.109Z","avatar_url":"https://github.com/STRd6.png","language":"JavaScript","readme":"[![Build](https://github.com/STRd6/jadelet/actions/workflows/build.yml/badge.svg)](https://github.com/STRd6/jadelet/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/STRd6/jadelet/badge.svg?branch=master)](https://coveralls.io/github/STRd6/jadelet?branch=master)\n\nJadelet\n=======\n\n*Pure and simple clientside templates*\n\nJadelet is the cleanest and simplest way to describe your templates. It is a\nbreeze to learn. Jadelet attributes correspond directly with HTML attributes.\nIf you know HTML then you already know Jadelet.\n\nOther libraries and frameworks put up barriers between you and the DOM. Like a\ndutiful servant, Jadelet brings the power of the DOM into _your_ hands.\n\nJadelet is the smallest of all clientside templating libraries (\u003c 5.8kb). But\ndon't let its size fool you: it contains tremendous power.\n\nJadelet is free, MIT licensed, open source, non-GMO, and production ready.\n\n- [Jadelet Homepage](https://danielx.net/jadelet/)\n- [Source](https://github.com/STRd6/jadelet)\n\nExamples\n--------\n\n#### Header\n\n```jade\nh1 @title\n```\n\n```javascript\nconst HeaderTemplate = require(\"./header\")\nconst headerElement = HeaderTemplate({\n  title: \"Hello world\"\n})\n```\n\n#### Button\n\n```jade\nbutton(@click) Say Hey\n```\n\n```javascript\nButtonTemplate = require(\"./button\")\nbuttonElement = ButtonTemplate({\n  click: function() {\n    alert(\"heyy\")\n  }\n})\n```\n\n[More examples](https://danielx.net/jadelet/)\n\nGetting Started\n---------------\n\nInstall Jadelet:\n\n```bash\nnpm install jadelet\n```\n\nCompile your templates:\n\n```bash\nnode_modules/.bin/jadelet -d templates\n```\n\nThis will create a .js version of each template in your templates directory.\n\nRequire your templates normally and let webpack or whatever other godforsaken\nbundler you use do its magic.\n\n```javascript\n// main.js\nmainTemplate = require(\"./templates/main\");\n\ndocument.body.appendChild(mainTemplate(data));\n```\n\nRoad to 1.0\n-----------\n\n- [x] Still under 2.5kb\n- [x] Don't Leak Resources\n- [x] Style Attributes\n- [x] Filters\n- [x] Changelog\n- [x] Example Playground\n- [x] | for text content\n- [x] Remove :filters\n- [x] Updated README.md\n- [ ] jadelet.com\n- [ ] Documentation\n- [ ] Getting Started Guide\n\nFAQ\n---\n\n#### Is Jadelet safe from XSS?\n\nYes. Jadelet uses native DOM APIs to write string output as text nodes.\n\n#### How do I use Jadelet to render HTML Elements?\n\nJadelet knows the type of objects it renders. When you pass an `HTMLElement`\n(or any other descendent of `window.Node`) it will insert it into the DOM as is.\n\n```jade\n.content\n  h1 My Canvas\n    @canvasElement\n```\n\n```javascript\nTemplate({\n  canvasElement: document.createElement('canvas')\n})\n```\n\n#### Is it production ready?\n\nYes, Jadelet's been used for years in production by glitch.com, whimsy.space,\nand danielx.net.\n\n#### Is it performant?\n\nYes! And because it's just DOM stuff you can easily drop down to the native DOM\nAPIs for the pieces of your app that need special optimization.\n\n#### How can I contribute?\n\nOpen some issues, open some pull requests, let's talk it out :)\n\nHistory\n-------\n\nJadelet was inspired by Haml and Jade. I kept removing features over the years\nuntil it was fast and simple enough for my tastes.\n\nGotchas\n-------\n\nTemplates must have only one root element, they will fail with multiple.\n\nGood:\n\n```jade\n.root\n  .one\n  .two\n```\n\nOopsies:\n\n```jade\n.one\n.two\n```\n\nCLI\n===\n\nCommand line interface for compiling templates.\n\nUsage\n-----\n\nJadelet in, JavaScript out.\n\n    jadelet \u003c template.jadelet \u003e output.js\n\n    echo \"h1#title @title\" | jadelet\n\nOptions\n-------\n\n`-d, --directory [directory]` Compile all .jadelet files in the given directory.\n\n```bash\njadelet -d templates\n```\n\n`--encoding [encoding]` Encoding of files being read from `--directory` (default `'utf-8'`)\n\n`--exports, -e [name]` Export compiled template as (default `\"module.exports\"`)\n\nWhen used with `-d` you can use $file to take on the stringified name of the\ncurrent file. For example:\n\n```bash\njadelet -d templates/ -e 'T[$file]'\n```\n\nThe files will export as:\n```javascript\nT[\"folder/subfolder/file\"] = require('jadelet').exec(...)\n```\n\n`--runtime, -r [runtime_name]` Specifies the name of the globally available Jadelet runtime (default is `\"require('jadelet')\"`).\n\nIf you are using `jadelet-brower.js` you'll want to replace this with 'Jadelet' so\nit can use the global in the browser.\n\n```bash\njadelet -r \"Jadelet\" \u003c template.jadelet \u003e output.js\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrd6%2Fjadelet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrd6%2Fjadelet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrd6%2Fjadelet/lists"}