How to Convert ODS to XLSX in Node.JS

Cloudmersive
The Startup
Published in
2 min readSep 28, 2020

--

OpenDocument Spreadsheet (ODS) is an XML-based format that is similar to Excel as it provides spreadsheet creation and editing capabilities. The main difference, however, is that ODS files are available for free through the OpenOffice suite. This provides users without standard access to the traditional Office suite with alternatives to its (often expensive) applications. To allow for improved sharing between the formats, XLSX and ODS, the following API will show you how to convert ODS to XLSX instantly.

Our first step is to install our SDK:

npm install cloudmersive-convert-api-client --save

Or, you can add this to this snippet to your package.json:

"dependencies": {
"cloudmersive-convert-api-client": "^2.4.8"
}

Then, you can call our function, ConvertDocumentOdsToXlsx:

var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveConvertApiClient.ConvertDocumentApi();var inputFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // File | Input file to perform the operation on.var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.convertDocumentOdsToXlsx(inputFile, callback);

With that, you can improve accessibility and affordability for your organizational documentation. You can access your free API Key on the Cloudmersive website. This will give you access to 800 monthly calls across our library of APIs.

--

--

Cloudmersive
The Startup

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.