score:1

Unfortunately, it is not possible to get a response as an SVG string instead of the file. However, it can be achieved by reading the file returned by the export callback. Optionally after this operation, the file can be removed.

Code:

exporter.export(exportSettings, function(err, res) {

  if (res.filename) {
    let svgString = fs.readFileSync(res.filename, 'utf8');

    console.log(svgString);

    // Remove the file optionally
    fs.unlinkSync(res.filename);
  }

  exporter.killPool();
  process.exit(1);
});

Related Query

More Query from same tag