NodeJS API to protect local Microsoft Excel and OpenOffice Calc spreadsheet with password

NodeJS library to protect local Microsoft Excel and OpenOffice Calc spreadsheet with password

Use Cells Protect REST API to protect local Microsoft Excel and OpenOffice Calc spreadsheet with password workflows in NodeJS. This professional solution protects Microsoft Excel and OpenOffice Calc spreadsheet online with passwords using NodeJS.

Protect local Microsoft Excel and OpenOffice Calc spreadsheet with password - NodeJS REST API

API Request:
POST
https://api.aspose.cloud/v3.0/cells/protect

Protecting a local spreadsheet with a password is a complex task. Protecting a local spreadsheet with password 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 protect local spreadsheets with a password online. This Cloud SDK gives NodeJS developers powerful functionality and perfect API.

Code example in Node using REST API to encryption local spreadsheets

// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-node/
const { LightCellsApi, PostProtectRequest } = require("asposecellscloud");
const clientId = process.env.CellsCloudClientId;
const clientSecret = process.env.CellsCloudClientSecret;
const ApiURL = process.env.CellsCloudApiBaseUrl;
const cellsApi = new LightCellsApi(clientId, clientSecret,"v3.0",ApiURL);
const fs = require('fs');
const path = require('path');
const localPath = "D:/aspose-cells-cloud-node/TestData/"
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 PostProtectRequest({
file: { AssemblyTestXlsx: dataAssemblyTestXlsx, DataSourceXlsx: dataDataSourceXlsx },
password : "123456"
});
cellsApi.postProtect(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 encrypt


  1. Create an account at Dashboard to get free API quota & authorization details
  2. Initialize CellsApi with Client Id, Client Secret, Base URL & API version
  3. Call postProtect method to get the resultant stream


System Requirements


  1. node v6.17.1 or newer