{"id":25823349,"url":"https://github.com/saada/xmetal","last_synced_at":"2026-06-11T19:31:07.724Z","repository":{"id":57401790,"uuid":"62469741","full_name":"saada/XMetaL","owner":"saada","description":"React-inspired XML/HTML component library for Javascript","archived":false,"fork":false,"pushed_at":"2016-08-03T12:38:56.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T17:38:09.176Z","etag":null,"topics":["html","javascript","xml"],"latest_commit_sha":null,"homepage":"https://github.com/saada/XMetaL","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/saada.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}},"created_at":"2016-07-02T21:06:37.000Z","updated_at":"2017-12-19T01:25:35.000Z","dependencies_parsed_at":"2022-09-15T18:21:52.409Z","dependency_job_id":null,"html_url":"https://github.com/saada/XMetaL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saada/XMetaL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saada%2FXMetaL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saada%2FXMetaL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saada%2FXMetaL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saada%2FXMetaL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saada","download_url":"https://codeload.github.com/saada/XMetaL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saada%2FXMetaL/sbom","scorecard":{"id":794063,"data":{"date":"2025-08-11","repo":{"name":"github.com/saada/XMetaL","commit":"8f5c4db00a87b1be6d11d8be1458d358e0192cf8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T08:25:07.150Z","repository_id":57401790,"created_at":"2025-08-23T08:25:07.150Z","updated_at":"2025-08-23T08:25:07.150Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285843614,"owners_count":27240943,"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-11-22T02:00:05.934Z","response_time":64,"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":["html","javascript","xml"],"created_at":"2025-02-28T11:53:24.041Z","updated_at":"2025-11-22T19:01:59.998Z","avatar_url":"https://github.com/saada.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :metal: XMetaL :metal:\n## XML/HTML functional component library for Javascript\n\nDesigned to work with any XML-based markup and can run both in the browser and on Node.\n\nXMetaL is heavily influenced by React and tries to remove a lot of the tooling overhead. \nIt allows you to get up and running quickly with minimal changes on your end.\n\n### Why another view library?\n* Pure functional Javascript\n* Scalable abstraction\n* No tooling required\n* No dependencies\n* No JSX, while still keeping markup easy to write\n* Can work with any XML markup, not just HTML\n* Server-side rendering just works\n\n### HTML helper\nHTML is probably the most popular XML-based language. \nTherefore, baked into XMetaL is a helper with a list of primitive html components.\nTo use those primitives, simply run\n```js\nconst {h1, h2, div} = require('./Html')\n```\nBehind the scenes, the HTML helpers creates components using the `createComponent` function.\nYou can create your own primitives based on the XML language in your domain.\n```js\nconst { createComponent } = require('xmetal')\nconst div = createComponent('div')\n```\n### Writing a component\n\nLet's create a component called MyComponent that is represented by a pure function that returns another component.\n```js\n// MyComponent.js\nconst {div} = require('./Html')\nmodule.exports = () =\u003e div({class: 'saada'})\n```\n\n\nComponents are composable and can be combined together to form larger components. \nLet's add more components to our previous example.\n```js\n// MyComponent.js\nconst {h1, h2, div} = require('./Html')\n\nmodule.exports = () =\u003e \n  div({class: 'saada'}, [\n    h1({}, 'Text1'),\n    div({}, [\n      h2({}, 'Text2')\n    ])\n  ])\n```\n\nYou can render your component by calling\n```js\nconst {render} = require('xmetal')\nconst MyComponent = require('./MyComponent')\n\nconst output = render(MyComponent())\nconsole.log(output)\n```\n\noutput\n```html\n\u003cdiv class=\"saada\"\u003e\n  \u003ch1\u003eText1\u003c/h1\u003e\n  \u003cdiv\u003e\n    \u003ch2\u003eText2\u003c/h2\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n## Props\n\nLet's add some props to make the text customizable\n```js\n// MyComponent.js\nconst {h1, h2, div} = require('./Html')\n\nmodule.exports = (props) =\u003e \n  div({class: props.class}, [\n    h1({}, props.header),\n    div({}, [\n      h2({}, props.subHeader)\n    ])\n  ])\n```\nLet's call render\n```js\nconst {render} = require('xmetal')\nconst MyComponent = require('./MyComponent')\n\nconst output = render(MyComponent({\n  class: 'red', \n  header: 'Header', \n  subHeader: 'Subheader'\n}))\nconsole.log(output)\n```\n\noutput\n```html\n\u003cdiv class=\"red\"\u003e\n  \u003ch1\u003eHeader\u003c/h1\u003e\n  \u003cdiv\u003e\n    \u003ch2\u003eSubheader\u003c/h2\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n### Children\n\nAlong with props, components take a second parameter of children which can be an array or a string.\nStrings are output directly inside the element by default and arrays are treated as child components.\nLet's say we want to pass an array of users and display a list of users. \n```js\n// User.js\nmodule.exports = (props) =\u003e li({}, `${props.firstname} ${props.lastname}`)\n\n// UserList.js\nconst {ul} = require('./Html')\nmodule.exports = (props = {}, children = []) =\u003e ul(props, children)\n\n// index.js\nconst users = [\n  { firstname: 'Gandalf', lastname: 'The Grey' },\n  { firstname: 'Michael', lastname: 'Jackson' }\n]\n\nconst {render} = require('xmetal')\nconst UserList = require('./UserList')\nconst User = require('./User')\n\nconst output = render(UserList({}, users.map((user) =\u003e User)))\nconsole.log(output)\n```\noutput\n```html\n\u003cul\u003e\n  \u003cli\u003eGandalf The Grey\u003c/li\u003e\n  \u003cli\u003eMichael Jackson\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n### Add Logic\nNow let's say we wanted to add some logic to the previous example. We can do so by adding more functions in our component file.\nLet's say we wanted to lowercase user first names and uppercase user last names.\n```js\n// User.js\nconst formatUserName = (user) =\u003e {\n  user.firstname = user.firstname.toLowerCase()\n  user.lastname = user.lastname.toUpperCase()\n}\n\nmodule.exports = (props) =\u003e {\n  let user = formatUserName(props)\n  return li({}, `${user.firstname} ${user.lastname}`)\n}\n```\n\nTODO:\n- [ ] Examples with CSS\n- [ ] Examples with browser routing\n- [ ] Examples with async calls\n- [ ] DOM Examples\n- [ ] DOM diffing\n- [ ] Cross browser support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaada%2Fxmetal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaada%2Fxmetal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaada%2Fxmetal/lists"}