NodeJS API to clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet
NodeJS Clear to clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet
Clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet - NodeJS REST API
API Request:
POST
https://api.aspose.cloud/v3.0/cells/clear
Clearing list objects on local Microsoft Excel and OpenOffice Calc spreadsheet is a complex task. Clearing list objects on local Microsoft Excel and OpenOffice Calc spreadsheet transitions is performed by our NodeJS SDK while maintaining the source spreadsheet's main structural and logical content. Our NodeJS library is a professional solution to clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet online. This Cloud SDK gives NodeJS developers powerful functionality and perfect API.
NodeJS code for clearing list objects on local spreadsheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { CellsApi, PostClearObjectsRequest } = require("asposecellscloud"); | |
const clientId = process.env.CellsCloudClientId; | |
const clientSecret = process.env.CellsCloudClientSecret; | |
const ApiURL = process.env.CellsCloudApiBaseUrl; | |
const localPath = "D:/aspose-cells-cloud-node/TestData/" | |
var fs = require('fs'); | |
var path = require('path'); | |
const cellsApi = new CellsApi(clientId, clientSecret,"v3.0",ApiURL); | |
const AssemblyTestXlsx = "assemblytest.xlsx"; | |
const DataSourceXlsx = "datasource.xlsx"; | |
const dataAssemblyTestXlsx = fs.createReadStream(path.join(localPath, AssemblyTestXlsx)); | |
const dataDataSourceXlsx = fs.createReadStream(path.join(localPath, DataSourceXlsx)); | |
const req = new PostClearObjectsRequest({ | |
file: { AssemblyTestXlsx: dataAssemblyTestXlsx, DataSourceXlsx: dataDataSourceXlsx }, | |
objecttype: "ListObject" | |
}); | |
cellsApi.postClearObjects(req) | |
.then((result) => { | |
console.log("successfully") | |
const buff = Buffer.from(result.body.files[0].fileContent, 'base64'); | |
fs.writeFileSync(result.body.files[0].filename, buff); | |
}) | |
.catch((error) => { | |
console.error('Unhandled Promise Rejection:', error); | |
}); |
How to use Node API to clear list objects
- Create an account at Dashboard to get free API quota & authorization details
- Initialize CellsApi with Client Id, Client Secret, Base URL & API version
- Call postClearObjects method to get the resultant stream
System Requirements
- node v6.17.1 or newer