
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
cloudflare-error-page
Advanced tools
Carbon copy of the original Python version.
npm install cloudflare-error-page
Or install from GitHub:
npm install git+https://github.com/donlon/cloudflare-error-page.git#main:nodejs
import { render } from 'cloudflare-error-page';
import * as fs from 'fs';
const errorPage = render({
browser_status: { status: 'ok' },
cloudflare_status: { status: 'error', status_text: 'Error' },
host_status: { status: 'ok', location: 'example.com' },
error_source: 'cloudflare',
what_happened: '<p>There is an internal server error on Cloudflare\'s network.</p>',
what_can_i_do: '<p>Please try again in a few minutes.</p>',
});
fs.writeFileSync('error.html', errorPage);
render(params: ErrorPageParams, allowHtml?: boolean): stringGenerates an HTML error page based on the provided parameters.
params: An object containing error page configurationallowHtml (optional): Whether to allow HTML in what_happened and what_can_i_do fields. Default: trueinterface ErrorPageParams {
// Basic information
error_code?: number; // Default: 500
title?: string; // Default: 'Internal server error'
html_title?: string; // Default: '{error_code}: {title}'
time?: string; // Auto-generated if not provided
ray_id?: string; // Auto-generated if not provided
client_ip?: string; // Default: '1.1.1.1'
// Status for each component
browser_status?: StatusItem;
cloudflare_status?: StatusItem;
host_status?: StatusItem;
// Error source indicator
error_source?: 'browser' | 'cloudflare' | 'host';
// Content sections
what_happened?: string; // HTML content
what_can_i_do?: string; // HTML content
// Optional customization
more_information?: MoreInformation;
perf_sec_by?: PerfSecBy;
creator_info?: CreatorInfo;
}
interface StatusItem {
status?: 'ok' | 'error';
status_text?: string; // Default: 'Working' or 'Error'
status_text_color?: string; // CSS color
location?: string;
name?: string;
}
import { render } from 'cloudflare-error-page';
const html = render({
cloudflare_status: { status: 'error' },
error_source: 'cloudflare',
what_happened: '<p>Something went wrong.</p>',
what_can_i_do: '<p>Try again later.</p>',
});
import express from 'express';
import { render } from 'cloudflare-error-page';
const app = express();
app.use((err, req, res, next) => {
const errorPage = render({
error_code: err.status || 500,
title: err.message || 'Internal server error',
cloudflare_status: { status: 'ok' },
host_status: {
status: 'error',
location: req.hostname
},
error_source: 'host',
what_happened: `<p>${err.message}</p>`,
what_can_i_do: '<p>Please try again or contact support.</p>',
});
res.status(err.status || 500).send(errorPage);
});
This package includes full TypeScript type definitions. Import types as needed:
import { render, ErrorPageParams, StatusItem } from 'cloudflare-error-page';
MIT
FAQs
Cloudflare Error Page Generator
We found that cloudflare-error-page demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.