diff --git a/CHANGELOG.md b/CHANGELOG.md index 485bbc8e..3a179a10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ _Fixes:_ - Fixed the warning message when the the default `resources.json` file is not found. - Fixed the problem with the lack of the `instr` value, when the `options` is set instead. -- Corrected the `Node.js Module` example in the README. # 4.0.2 diff --git a/README.md b/README.md index 7c2a83d8..f2d39fcb 100644 --- a/README.md +++ b/README.md @@ -569,23 +569,20 @@ const options = { }; -// 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(); - }); -})(); +// 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(); +}); ``` ## CommonJS support