How to Convert ODS to XLSX in Node.JS

Cloudmersive
2 min readJun 29, 2020

Sometimes a simple document conversion can end up being a total slog through the coding mud. It’s at times like this that you need a nice shortcut to get you through. I have just such a one for you that will allow easy conversion between ODS and XLSX, and it will only require mere minutes of your time to get started. Let’s dive straight in.

We will use an API to get this done fast, so let’s add it as a dependency to our package.json file.

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

Now we can call our function with this bit of code here:

var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveConvertApiClient.ConvertDocumentApi();var inputFile = "/path/to/file; // 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);

Easy! That’s all there is to it!

--

--

Cloudmersive

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