Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

563/async-example-readme #565

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

_New Features:_

- Added support for absolute paths in the `HIGHCHARTS_CACHE_PATH` option [(#562)](https://github.com/highcharts/node-export-server/issues/562)
- Added support for absolute paths in the `HIGHCHARTS_CACHE_PATH` option [(#562)](https://github.com/highcharts/node-export-server/issues/562).

_Fixes_:

- Improved status codes (user errors instead of 500) [(#577)](https://github.com/highcharts/node-export-server/pull/577)

- Improved memory management/usage [(#586)](https://github.com/highcharts/node-export-server/pull/586)
- Improved status codes (user errors instead of 500) [(#577)](https://github.com/highcharts/node-export-server/pull/577).
- Improved memory management/usage [(#586)](https://github.com/highcharts/node-export-server/pull/586).
- Corrected the `Node.js Module` example in the README.

_Other:_

- Add fair usage policy note on the page [(#583)](https://github.com/highcharts/node-export-server/pull/583)
- Add fair usage policy note on the page [(#583)](https://github.com/highcharts/node-export-server/pull/583).

# 4.0.2

Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,20 +570,24 @@ 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);
// Logic must be triggered in an asynchronous function
(async () => {
// Initialize export settings with your chart's config
const exportSettings = exporter.setOptions(options);

// Perform an export
await exporter.startExport(exportSettings, async (error, info) => {
// The export result is now in info
// It will be base64 encoded (info.data)
// Must initialize exporting before being able to export charts
await exporter.initExport(exportSettings);

// Kill the pool when we are done with it
await exporter.killPool();
});
// 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
Loading