Aspose.Cells Cloud SDK for Node

The SDK is open-source and licensed under the MIT License. You can access the Node library source code for Aspose.Cells Cloud here.

How to use Node library of Aspose.Cells Cloud

Aspose.Cells Cloud SDK for Node is a powerful library that allows developers to manipulate and process Microsoft Excel files using the Node programming language. With this SDK, you can create, edit, and convert Excel documents in the cloud, without installing additional software or dependencies on your local machine.

In this article, we’ll explore how to use Aspose.Cells Cloud SDK for Node to perform some common tasks, such as creating a new Excel workbook, inserting data into cells, and saving the modified workbook to the cloud.

Getting Started

Before you can start using the Aspose.Cells Cloud SDK for Go, you need to set up your development environment and install the necessary dependencies. Refer to the article on the Aspose website to obtain your client ID and client secret.

How to install the Node package for Aspose.Cells Cloud

You can install Aspose.Cells Cloud SDK for Node using npm. Below are the steps for npm:


npm install asposecellscloud

How to add dependencies in package configuration for Aspose.Cells Cloud

node configuration file : package.json


{
    "requires": true,
    "lockfileVersion": 1,
    "dependencies": {
        "@types/jest": "^26.0.24",
        "@types/request": "^2.48.7",
        "asposecellscloud": "24.4",
        "axios": "^1.5.1",
        "JSON": "^1.0.0",
        "mocha": "^10.2.0",
        "request": "^2.88.2",
        "request-debug": "^0.2.0"
    }
}

How to use Node package to convert Xlsx to PDF

  • Import Aspose.Cells Cloud Library Begin by importing the necessary package from the Aspose.Cells Cloud NodeJS SDK into your project.
  • Configure API Client with Credentials Authenticate your API client with your unique client ID and client secret.
  • Prepare Conversion Parameters Define parameters for the conversion task, including the source file name, desired output format, and the storage folder path.
  • Execute Workbook Conversion Invoke the conversion process using the PostConvertWorkbook method and handle the response.
var fs = require('fs');
var path = require('path');
const _ = require('asposecellscloud');

const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret,"v3.0",process.env.CellsCloudApiBaseUrl);

var remoteFolder = "TestData/In"
  
var localName = "Book1.xlsx"
var remoteName = "Book1.xlsx"

var localNameRequest = new  model.UploadFileRequest();
localNameRequest.uploadFiles ={localName:fs.createReadStream(localPath  + localName)};
localNameRequest.path = remoteFolder + "/" + remoteName ;
localNameRequest.storageName ="";
cellsApi.uploadFile(localNameRequest );
 
var format = "csv"

var mapFiles = {};           

 mapFiles[localName]= fs.createReadStream(localPath  +localName) ;

var request = new model.PutConvertWorkbookRequest();
request.file =  mapFiles;
request.format =  format;
return cellsApi.putConvertWorkbook(request).then((result) => {
    expect(result.response.statusCode).to.equal(200);
});