{"id":15766959,"url":"https://github.com/lamplightdev/wafer","last_synced_at":"2025-04-21T03:32:22.490Z","repository":{"id":48496406,"uuid":"367355301","full_name":"lamplightdev/wafer","owner":"lamplightdev","description":"A simple and lightweight base library for building Web Components for use in the browser and on the server","archived":false,"fork":false,"pushed_at":"2021-10-04T21:30:42.000Z","size":271,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T07:40:18.802Z","etag":null,"topics":["javascript","web-components"],"latest_commit_sha":null,"homepage":"https://waferlib.netlify.app","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/lamplightdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-14T12:27:01.000Z","updated_at":"2024-02-25T20:02:57.000Z","dependencies_parsed_at":"2022-08-25T18:53:05.801Z","dependency_job_id":null,"html_url":"https://github.com/lamplightdev/wafer","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamplightdev%2Fwafer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamplightdev%2Fwafer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamplightdev%2Fwafer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamplightdev%2Fwafer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamplightdev","download_url":"https://codeload.github.com/lamplightdev/wafer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249991128,"owners_count":21357204,"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":["javascript","web-components"],"created_at":"2024-10-04T13:04:16.945Z","updated_at":"2025-04-21T03:32:22.191Z","avatar_url":"https://github.com/lamplightdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"./images/logo.svg\" alt=\"\" width=\"160\"\u003e\n\u003c/p\u003e\n\n# Wafer\n\n[![Tests](https://github.com/lamplightdev/wafer/actions/workflows/node.js.yml/badge.svg)](https://github.com/lamplightdev/wafer/actions/workflows/node.js.yml)\n[![npm](https://img.shields.io/npm/v/@lamplightdev/wafer)](https://www.npmjs.com/package/@lamplightdev/wafer)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@lamplightdev/wafer)](https://bundlephobia.com/package/@lamplightdev/wafer)\n\nWelcome to Wafer: a simple and lightweight base library for building Web Components that can be used on the browser, server or both.\n\nWafer is:\n\n- **Small** 🪶\u003cbr/\u003e\n  \u003c2kb (minified and compressed)\n\n- **Fast** ⚡️\u003cbr/\u003e\n  Template updates are declared using CSS selectors leveraging native browser performance\n\n- **Efficient** 🔋\u003cbr/\u003e\n  Updates are batched preventing any unnecessary renders\n\n- **Flexible** 💪🏾 \u003cbr/\u003e\n  Import directly, drop in a `\u003cscript\u003e` tag, or use your favourite bundler\n\n- **Server ready** ▶️\u003cbr/\u003e\n  Wafer components can be used unchanged in browsers and on the server\n\n## Documentation\n\nPlease visit the [documentation site](https://waferlib.netlify.app/). To get started checkout how to [install Wafer](https://waferlib.netlify.app/docs/010-overview/020-installation/), read through a [quick guide](https://waferlib.netlify.app/docs/010-overview/030-quick/) outlining the basic concepts, or dive in to a [live example](https://waferlib.netlify.app/docs/010-overview/040-example/).\n\n## Installation\n\nThe Wafer package contains both the client and server libraries. To install for use with build tools and/or server usage, use your favourite package manager:\n\n```\nnpm install --save @lamplightdev/wafer\n```\n\nYou can then import the required base class:\n\n```js\nimport Wafer from \"@lamplightdev/wafer\";\n\nclass MyExample extends Wafer {}\n\ncustomElements.define(\"my-example\", MyExample);\n```\n\nor import directly from a CDN to use without a package manager or bundler:\n\n```js\nimport Wafer from \"https://unpkg.com/@lamplightdev/wafer\";\n```\n\nAlternatively if you are feeling retro use a `\u003cscript\u003e` tag:\n\n```html\n\u003cscript src=\"https://unpkg.com/@lamplightdev/wafer/dist/wafer.browser.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  class MyExample extends Wafer {}\n\n  customElements.define(\"my-example\", MyExample);\n\u003c/script\u003e\n```\n\nOn the server Wafer is available as both an ES and a CJS module:\n\n```js\n// ES module\nimport WaferServer from \"@lamplightdev/wafer/server/wafer.js\";\n// or CJS\nconst WaferServer = require(\"@lamplightdev/wafer/server/wafer\");\n\nclass MyExample extends WaferServer {}\n```\n\n## Building\n\nThe source files are located in the `/src` folder, and can be built with:\n\n```\nnpm run build\n```\n\nThis will lint the code, create Typescript types from JSDoc comments, run tests and finally build the package files. To run these steps individually please see the `scripts` entries in `package.json`.\n\n## Contributing\n\nAll contributions are welcome - please file an issue or submit a PR.\n\n## License\n\nThe code is released under the [MIT license](./LICENSE.md).\n\n## Credits\n\nWafer was created by [Chris](https://lamplightdev.com/) ([@lamplightdev](https://twitter.com/lamplightdev)) - say hi!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamplightdev%2Fwafer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamplightdev%2Fwafer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamplightdev%2Fwafer/lists"}