Skip to content

Commit

Permalink
Updated the Node.js Module example in the README, touch #563.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDalek committed Feb 10, 2025
1 parent 48d3794 commit 44c8c7b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 4.0.3

_Fixes:_

- Corrected the `Node.js Module` example in the README.

# 4.0.2

_Hotfix_:
Expand Down
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,20 +570,23 @@ const options = {
}
};
// Initialize export settings with your chart's config
const exportSettings = exporter.setOptions(options);
// Must initialize exporting before being able to export charts
await exporter.initExport(exportSettings);
// Perform an export
await exporter.startExport(exportSettings, async (error, info) => {
// The export result is now in info
// It will be base64 encoded (info.data)
// Kill the pool when we are done with it
await exporter.killPool();
});
// Logic must be triggered in an asynchronous function
(async () => {
// Initialize export settings with your chart's config
const exportSettings = exporter.setOptions(options);
// Must initialize exporting before being able to export charts
await exporter.initExport(exportSettings);
// Perform an export
await exporter.startExport(exportSettings, async (error, info) => {
// The export result is now in info
// It will be base64 encoded (info.result)
// Kill the pool when we are done with it
await exporter.killPool();
});
})();
```

## CommonJS support
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Highsoft AS <[email protected]> (http://www.highcharts.com/about)",
"license": "MIT",
"type": "module",
"version": "4.0.2",
"version": "4.0.3",
"main": "./dist/index.esm.js",
"engines": {
"node": ">=18.12.0"
Expand Down

0 comments on commit 44c8c7b

Please sign in to comment.