https://github.com/marko-js/ssr-to-html
Crawl a server rendered application and output html files.
https://github.com/marko-js/ssr-to-html
Last synced: 2 months ago
JSON representation
Crawl a server rendered application and output html files.
- Host: GitHub
- URL: https://github.com/marko-js/ssr-to-html
- Owner: marko-js
- License: mit
- Created: 2021-05-03T20:27:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-24T15:41:15.000Z (almost 4 years ago)
- Last Synced: 2025-09-13T15:34:14.682Z (3 months ago)
- Language: TypeScript
- Size: 199 KB
- Stars: 9
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
ssr-to-html
Crawl a server rendered application and output html files.
# Installation & Usage
## Globally
_npm_
```terminal
# Install
npm install ssr-to-html -g
# Use
ssr-to-html
```
## Locally
_npm_
```terminal
# Install
npm install ssr-to-html
# Use with npm 7
npm exec -- ssr-to-html
# Use with npm <6
npx ssr-to-html
```
_yarn_
```terminal
# Install
yarn install ssr-to-html
# Use
yarn ssr-to-html
```
# Examples (assuming globally installed)
```terminal
$ ssr-to-html --out ./dist -- npm start
```
The above will execute the `npm start` command and wait for a server to begin listening.
Once the server has started, we crawl the site starting from `/` and output `.html` files in the `./dist` directory.
# Options
| Option | Details |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `--out, -o` | The directory that the ".html" files will be written to. |
| `--port` | The port of the server to connect to. This also sets "process.env.PORT". (default to a random available port) |
| `--wait` | The total amount of time in ms to wait for the server to start on the specified port. Setting to 0 will disable this timeout. (default 30000) |
| `--path, -p` | An additional path to crawl. (default will crawl from /) |
| `--404` | The path to the 404 page. (default /404/) |
| `--help, -h` | Shows helpful information. |
# Code of Conduct
This project adheres to the [eBay Code of Conduct](./.github/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.