Release Unmanaged Resources of the Workbook with Node.js via C++

Contents
[ ]

Workbook object now implements the System.IDisposable interface, which has a single method Workbook.dispose(). You can either call the Workbook.dispose() method directly or use the using statement to have this method called automatically.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

 // The path to the documents directory.
 const dataDir = path.join(__dirname, "data");
 const filePath = path.join(dataDir, "sample.xlsx");
 // Load the workbook which contains hidden external links
 const workbook = new AsposeCells.Workbook(filePath);

 // Create a workbook object
 const wb1 = new AsposeCells.Workbook();

 // Call the Dispose method
 wb1.dispose();

 // Call the Dispose method via a scoped approach
 (async () => {
   const wb2 = new AsposeCells.Workbook();
   // Any other code goes here
   wb2.dispose();
 })();