How highcharts/node-export-server works
Highcharts Node.js Export Server converts chart-option JSON or SVG into PNG, JPEG, SVG, or PDF. Users can invoke it through the CLI, an HTTP service, or the Node.js module API. In each mode, configuration and initialization lead to export work; pooled Puppeteer workers render the chart, and the result is returned to the caller. The README also documents Highcharts CDN caching and optional npm-based scripts. Some implementation files were not excerpted, so edges involving them rely on the SOURCE INDEX or README; uncertain wiring is omitted.
Main entry points: index.js Module API · server.js HTTP server · pool.js Worker pool · export.js Rendering and export
Components 26
Entry points
- CLI
bin/cli.js - Module API
lib/index.js
Configuration and setup
- Configuration
lib/config.js - Default settings
lib/schemas/config.js - Environment parsing
lib/envs.js - Highcharts cache
lib/cache.js - Script fetching
lib/fetch.js
Export runtime
- Chart preparation
lib/chart.js - Input sanitization
lib/sanitize.js - Worker pool
lib/pool.js - Puppeteer browser
lib/browser.js - Rendering and export
lib/export.js - Highcharts loader
lib/highcharts.js - SVG export template
templates/svg_export/svg_export.js
HTTP service
- HTTP server
lib/server/server.js - Export endpoint
lib/server/routes/export.js - Health endpoint
lib/server/routes/health.js - Version endpoint
lib/server/routes/change_hc_version.js - UI endpoint
lib/server/routes/ui.js
Runtime support
- Resource cleanup
lib/resource_release.js - Logging
lib/logger.js - Export errors
lib/errors/ExportError.js
Other components
- CLI user
- Module caller
- HTTP client
- Highcharts CDN
Connections 33
- CLI user → CLI: runs
README.md - CLI → Module API: invokes
bin/cli.js - Module caller → Module API: calls
README.md - HTTP client → HTTP server: sends requests
README.md - Module API → Configuration: configures
lib/index.js - Configuration → Default settings: loads defaults
lib/config.js - Configuration → Environment parsing: uses parsed values
lib/config.js - Module API → Highcharts cache: updates cache
lib/index.js - Highcharts cache → Script fetching: fetches scripts
lib/cache.js - Script fetching → Highcharts CDN: retrieves scripts
README.md - Module API → Worker pool: initializes pool
lib/index.js - Module API → HTTP server: starts server
lib/index.js - Module API → Chart preparation: exports charts
lib/index.js - Chart preparation → Worker pool: dispatches work
lib/chart.js - Chart preparation → Input sanitization: sanitizes input
lib/chart.js - Chart preparation → Configuration: reads options
lib/chart.js - Worker pool → Puppeteer browser: creates pages
lib/pool.js - Worker pool → Rendering and export: runs export
lib/pool.js - Rendering and export → Puppeteer browser: renders in
lib/export.js - Rendering and export → Highcharts cache: uses cached scripts
lib/export.js - Rendering and export → Highcharts loader: loads scripts
lib/export.js - Rendering and export → SVG export template: uses template
lib/export.js - HTTP server → Export endpoint: registers route
lib/server/server.js - HTTP server → Health endpoint: registers route
lib/server/server.js - HTTP server → Version endpoint: registers route
lib/server/server.js - HTTP server → UI endpoint: registers route
lib/server/server.js - Export endpoint → Chart preparation: requests export
lib/server/routes/export.js - Health endpoint → Worker pool: checks pool
lib/server/routes/health.js - Health endpoint → Puppeteer browser: checks browser
lib/server/routes/health.js - Health endpoint → Highcharts cache: checks cache
lib/server/routes/health.js - Version endpoint → Highcharts cache: updates cache
lib/server/routes/change_hc_version.js - Module API → Resource cleanup: cleans resources
lib/index.js - Worker pool → Export errors: raises errors
lib/pool.js