9
0
mirror of https://github.com/donlon/cloudflare-error-page.git synced 2025-12-29 11:49:09 +00:00

readme: update description for JavaScript/NodeJS

This commit is contained in:
Anthony Donlon
2025-12-23 00:11:19 +08:00
parent b2164729b4
commit 5a633b5958
3 changed files with 48 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ npm install cloudflare-error-page
Or install from GitHub:
```bash
npm install git+https://github.com/donlon/cloudflare-error-page.git#main:nodejs
npm install git+https://github.com/donlon/cloudflare-error-page.git#javascriptnodejs
```
## Quick Start
@@ -34,7 +34,7 @@ fs.writeFileSync('error.html', errorPage);
## API Reference
### `render(params: ErrorPageParams, allowHtml?: boolean): string`
### `render(params: ErrorPageParams, allowHtml?: boolean, moreArgs?: { [name: string]: any; }): string`
Generates an HTML error page based on the provided parameters.
@@ -42,6 +42,7 @@ Generates an HTML error page based on the provided parameters.
- `params`: An object containing error page configuration
- `allowHtml` (optional): Whether to allow HTML in `what_happened` and `what_can_i_do` fields. Default: `true`
- `moreArgs` (optional): More arguments passed to the ejs template
#### ErrorPageParams Interface