{"id":19346451,"url":"https://github.com/canjs/can-zone-jsdom","last_synced_at":"2025-07-28T11:02:51.203Z","repository":{"id":57193519,"uuid":"104365818","full_name":"canjs/can-zone-jsdom","owner":"canjs","description":"A Zone plugin for using JSDOM for server rendering","archived":false,"fork":false,"pushed_at":"2022-10-08T21:19:36.000Z","size":129,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-29T12:18:44.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/can-zone-jsdom","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/canjs.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}},"created_at":"2017-09-21T15:29:12.000Z","updated_at":"2019-06-19T22:40:04.000Z","dependencies_parsed_at":"2022-09-15T22:31:06.394Z","dependency_job_id":null,"html_url":"https://github.com/canjs/can-zone-jsdom","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/canjs/can-zone-jsdom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-zone-jsdom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-zone-jsdom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-zone-jsdom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-zone-jsdom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canjs","download_url":"https://codeload.github.com/canjs/can-zone-jsdom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-zone-jsdom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267505099,"owners_count":24098346,"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-07-28T02:00:09.689Z","response_time":68,"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-10T04:10:23.138Z","updated_at":"2025-07-28T11:02:51.145Z","avatar_url":"https://github.com/canjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# can-zone-jsdom\n\n__can-zone-jsdom__ is a [Zone plugin](https://github.com/canjs/can-zone) that provides a DOM implementation backed by [jsdom](https://github.com/jsdom/jsdom).\n\n[![Build Status](https://travis-ci.org/canjs/can-zone-jsdom.svg?branch=master)](https://travis-ci.org/canjs/can-zone-jsdom)\n[![npm version](https://badge.fury.io/js/can-zone-jsdom.svg)](http://badge.fury.io/js/can-zone-jsdom)\n\n## Install\n\n```\nnpm install can-zone-jsdom --save\n```\n\n## Usage\n\nThe most common way to use can-zone-jsdom is to provide a HTML page as the entry point. This page will be loaded in a new JSDOM context, and its scripts executed. Below shows using the plugin within an [Express](https://expressjs.com/) app.\n\n```js\nconst Zone = require('can-zone');\nconst express = require('express');\nconst app = express();\n\nconst dom = require('can-zone-jsdom');\nconst requests = require('done-ssr/zones/requests');\n\napp.use(express.static('build', { index: false }));\napp.use(express.static('.'));\n\napp.get('*', async (request, response) =\u003e {\n  var zone = new Zone([\n    // Overrides XHR, fetch\n    requests(request),\n\n    // Sets up a DOM\n    dom(request, {\n      root: __dirname + '/../build',\n      html: 'index.html'\n    })\n  ]);\n\n  const { html } = await zone.run();\n  response.end(html);\n});\n\napp.listen(8080);\n```\n\nSee [this guide](https://donejs.com/ssr-react.html) for a more full featured example using incremental rendering within a [React app](https://reactjs.org/).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanjs%2Fcan-zone-jsdom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanjs%2Fcan-zone-jsdom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanjs%2Fcan-zone-jsdom/lists"}