{"id":15099495,"url":"https://github.com/matthiaskainer/pure-lit","last_synced_at":"2025-10-07T07:22:48.844Z","repository":{"id":38343552,"uuid":"277165885","full_name":"MatthiasKainer/pure-lit","owner":"MatthiasKainer","description":"Register your lit-elements as a pure functions.","archived":false,"fork":false,"pushed_at":"2024-09-25T15:30:54.000Z","size":1911,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T18:44:22.014Z","etag":null,"topics":["html","javascript","lit","lit-html","web-component","web-components"],"latest_commit_sha":null,"homepage":"https://pure-lit.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatthiasKainer.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2020-07-04T18:36:12.000Z","updated_at":"2024-10-28T17:09:00.000Z","dependencies_parsed_at":"2023-02-06T18:46:52.264Z","dependency_job_id":"db414aeb-b98b-4526-9450-0d704cf7a753","html_url":"https://github.com/MatthiasKainer/pure-lit","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/MatthiasKainer/pure-lit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthiasKainer%2Fpure-lit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthiasKainer%2Fpure-lit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthiasKainer%2Fpure-lit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthiasKainer%2Fpure-lit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatthiasKainer","download_url":"https://codeload.github.com/MatthiasKainer/pure-lit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthiasKainer%2Fpure-lit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278738017,"owners_count":26037128,"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-10-07T02:00:06.786Z","response_time":59,"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","lit","lit-html","web-component","web-components"],"created_at":"2024-09-25T17:22:15.374Z","updated_at":"2025-10-07T07:22:48.816Z","avatar_url":"https://github.com/MatthiasKainer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pure-lit\n\n[![Version](https://img.shields.io/npm/v/pure-lit?style=for-the-badge)](https://www.npmjs.com/package/pure-lit)\n[![Size](https://img.shields.io/bundlephobia/minzip/pure-lit?style=for-the-badge)](https://bundlephobia.com/result?p=pure-lit)\n[![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/pure-lit?style=for-the-badge)](https://snyk.io/test/github/MatthiasKainer/pure-lit?targetFile=package.json)\n[![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen?style=for-the-badge)](https://bundlephobia.com/result?p=pure-lit)\n![Statements](docs/badges/badge-statements.svg)\n![Branch](docs/badges/badge-branches.svg)\n![Functions](docs/badges/badge-functions.svg)\n![Lines](docs/badges/badge-lines.svg)\n\n\u003e [lit](https://lit.dev/) with pure functions.\n\n\n## Install\n\n`npm install pure-lit`\n\nor add it to your page as module like this:\n\n`\u003cscript type=\"module\" src=\"https://unpkg.com/pure-lit@latest?module\"\u003e\u003c/script\u003e`\n\n## Getting started\n\n[![pure-lit.org](docs/img/documentation-button.png)](https://pure-lit.org)\n\nThe quickest way of getting started is by using JavaScript modules.\n\nCreate a file `index.html` that looks like this:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\" /\u003e\n    \u003ctitle\u003eAwesome pure-lit\u003c/title\u003e\n    \u003cscript type=\"module\"\u003e\n      import { html } from \"https://unpkg.com/lit@latest?module\";\n      import { pureLit } from \"https://unpkg.com/pure-lit@latest?module\";\n\n      pureLit(\n        \"hello-you\",\n        async ({ who }) =\u003e {\n          return html`\u003cdiv\u003eHello ${who}!\u003c/div\u003e`;\n        },\n        {\n          defaults: { who: \"\" },\n        }\n      );\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003chello-you who=\"me\"\u003e\u003c/hello-you\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nOpen it in the browser. Done.\n\n## Adding some state \n\npureLit exports the hooks from [lit-element-state-decoupler](https://github.com/MatthiasKainer/lit-element-state-decoupler) and [lit-element-effect](https://github.com/MatthiasKainer/lit-element-effect) which you can use to manage your state inside the functional components.\n\nYou can import them via\n\n```typescript\nimport { pureLit, useState, useReducer, useWorkflow, useEffect, useOnce } from \"pure-lit\";\n```\n\nand then use them like this:\n\n```typescript\npureLit(\"hello-world\", (element) =\u003e {\n    const counter = useState(element, 0);\n    return html`\u003cbutton @click=\"${() =\u003e counter.set(counter.get() + 1)}\"\u003eYou clicked me ${counter.get()} times!\u003c/button\u003e`\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiaskainer%2Fpure-lit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthiaskainer%2Fpure-lit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiaskainer%2Fpure-lit/lists"}