{"id":21167109,"url":"https://github.com/exalt/exalt-ssr","last_synced_at":"2025-09-17T16:34:00.493Z","repository":{"id":143748268,"uuid":"374239457","full_name":"exalt/exalt-ssr","owner":"exalt","description":"A module to render web components on the server.","archived":false,"fork":false,"pushed_at":"2021-10-27T18:27:03.000Z","size":263,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-09T18:05:51.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/exalt.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-06T00:48:27.000Z","updated_at":"2025-02-05T02:08:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"58e37b5c-14a3-46b4-a83e-609e91bbe910","html_url":"https://github.com/exalt/exalt-ssr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/exalt/exalt-ssr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exalt%2Fexalt-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exalt%2Fexalt-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exalt%2Fexalt-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exalt%2Fexalt-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exalt","download_url":"https://codeload.github.com/exalt/exalt-ssr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exalt%2Fexalt-ssr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275623477,"owners_count":25498340,"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-09-17T02:00:09.119Z","response_time":84,"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":[],"created_at":"2024-11-20T14:59:37.633Z","updated_at":"2025-09-17T16:34:00.488Z","avatar_url":"https://github.com/exalt.png","language":"JavaScript","funding_links":["https://www.patreon.com/outwalkstudios"],"categories":[],"sub_categories":[],"readme":"# Exalt SSR\nA module to render web components on the server.\n\n![Actions](https://github.com/exalt/exalt-ssr/workflows/build/badge.svg)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/exalt/exalt-ssr/blob/main/LICENSE)\n[![Donate](https://img.shields.io/badge/patreon-donate-green.svg)](https://www.patreon.com/outwalkstudios)\n[![Follow Us](https://img.shields.io/badge/follow-on%20twitter-4AA1EC.svg)](https://twitter.com/exaltjs)\n\n---\n\n## Installation\n\nYou can install @exalt/ssr using npm:\n\n```\nnpm install @exalt/ssr\n```\n\n---\n\n## Getting Started\n\n@exalt/ssr provides 2 functions to render web components on the server.\n\n- `loadBundle(path)` - initalizes the DOM environment and loads the application bundle.\n- `renderToString(component, callback)` - renders a component to a string.\n\nThe DOM environment provided is a subset of the DOM spec and is designed to render exalt components,\nhowever as long as the required apis are provided any web component can be rendered.\n@exalt/ssr will detect a components props and serialize them as a script tag in the markup.\n\nWhen a shadow root is detected it will be rendered as a [declarative shadow root](https://web.dev/declarative-shadow-dom/).\n\n**Example - Rendering the app component**\n```js\nimport { loadBundle, renderToString } from \"@exalt/ssr\";\nimport path from \"path\";\n\nconst bundlePath = path.join(process.cwd(), \"dist\", \"index.js\");\n\n/* loadBundle returns the bundle exports, in this case it returns the App component */\nconst { App } = loadBundle(bundlePath);\nconst html = renderToString(new App());\n\nconsole.log(html);\n```\n\n**Example - Rendering the app component with callback**\n```js\nimport { loadBundle, renderToString } from \"@exalt/ssr\";\nimport path from \"path\";\n\nconst bundlePath = path.join(process.cwd(), \"dist\", \"index.js\");\n\n/* loadBundle returns the bundle exports, in this case it returns the App component */\nconst { App } = loadBundle(bundlePath);\nconst html = renderToString(new App(), (currentNode) =\u003e {\n    console.log(`Rendering: ${currentNode.nodeName}`);\n});\n\nconsole.log(html);\n```\n\n---\n\n## Reporting Issues\n\nIf you are having trouble getting something to work with exalt or run into any problems, you can create a new [issue](https://github.com/exalt/exalt-ssr/issues).\n\nIf this framework does not fit your needs or is missing a feature you would like to see, let us know! We would greatly appreciate your feedback on it.\n\n---\n\n## License\n\nExalt SSR is licensed under the terms of the [**MIT**](https://github.com/exalt/exalt-ssr/blob/main/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexalt%2Fexalt-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexalt%2Fexalt-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexalt%2Fexalt-ssr/lists"}