{"id":13517206,"url":"https://github.com/briefjs/briefjs","last_synced_at":"2025-03-31T07:31:09.329Z","repository":{"id":216998518,"uuid":"162661169","full_name":"briefjs/briefjs","owner":"briefjs","description":"Deadly simple declarative JavaScript framework for building UI.","archived":false,"fork":false,"pushed_at":"2018-12-24T02:32:36.000Z","size":96,"stargazers_count":68,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-01T22:38:05.614Z","etag":null,"topics":["components","declarative","dom","framework","react","ui"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/briefjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-21T03:31:06.000Z","updated_at":"2024-04-18T16:49:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f241e86-6177-40bf-b630-41a007390033","html_url":"https://github.com/briefjs/briefjs","commit_stats":null,"previous_names":["briefjs/briefjs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briefjs%2Fbriefjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briefjs%2Fbriefjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briefjs%2Fbriefjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briefjs%2Fbriefjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briefjs","download_url":"https://codeload.github.com/briefjs/briefjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246433168,"owners_count":20776547,"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":["components","declarative","dom","framework","react","ui"],"created_at":"2024-08-01T05:01:31.100Z","updated_at":"2025-03-31T07:31:09.324Z","avatar_url":"https://github.com/briefjs.png","language":"JavaScript","readme":"# BriefJS\n\nDeadly simple declarative JavaScript framework for building UI.\n\n## Why BriefJS?\n\n- Tiny size. (_\u003c 3kb gzipped_)\n- Zero dependence.\n- Pure ES6.\n- No compiler. (_Directly use taged template strings_).\n- Stateless.\n- Fast and extendable.\n\n## Installation\n\nFrom CDN:\n\n```html\n\u003cscript src=\"https://unpkg.com/briefjs/dist/brief.min.js\"\u003e\u003c/script\u003e\n```\n\nWith NPM:\n\n```bash\nnpm install briefjs\n```\n\n## Example\n\n```js\nconst {tags, component, render} = briefjs;\nconst {div, span} = tags;\n\nfunction randomColor() {\n  const r = Math.round(Math.random() * 255);\n  const g = Math.round(Math.random() * 255);\n  const b = Math.round(Math.random() * 255);\n  return `rgb(${r},${g},${b})`;\n}\n\nconst MyTag = component({\n  props: {\n    color: 'red;',\n    onclick: 'void(0)',\n  },\n  render(props, slot) {\n    return div({style: {color: props.color}, onclick: props.onclick})`\n      ${span({ref: 'foo'})`1`}\n      ${span`${props.color}`}\n      ${slot}\n    `;\n  },\n  updated() {\n    console.log(this.refs);\n  },\n});\n\nconst Outer = component({\n  render(props, slot) {\n    let color = randomColor();\n    const onclick = () =\u003e {\n      color = randomColor();\n      this.update();\n    };\n    return MyTag({color, onclick})`${slot}`;\n  },\n  updated() {\n    this.node.addEventListener('mousedown', () =\u003e {\n      console.log('mousedown');\n    });\n  },\n});\n\nconst tpl = div`\n  ${Outer`\n    ${span`abc`}\n  `}\n  ${span`3`}\n  ${span`4`}\n  ${div`\n    ${span`5`}\n  `}\n`;\n\nrender(tpl, document.getElementById('app'));\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriefjs%2Fbriefjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriefjs%2Fbriefjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriefjs%2Fbriefjs/lists"}