Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libreoffice-convert

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libreoffice-convert - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

32

index.js

@@ -13,2 +13,3 @@ 'use strict';

const asyncOptions = (options || {}).asyncOptions || {};
const execOptions = (options || {}).execOptions || {};
const tempDir = tmp.dirSync({prefix: 'libreofficeConvert_', unsafeCleanup: true, ...tmpOptions});

@@ -49,9 +50,14 @@ const installDir = tmp.dirSync({prefix: 'soffice', unsafeCleanup: true, ...tmpOptions});

convert: ['soffice', 'saveSource', (results, callback) => {
let command = `-env:UserInstallation=${url.pathToFileURL(installDir.name)} --headless --convert-to ${format}`;
if (filter !== undefined) {
command += `:"${filter}"`;
}
command += ` --outdir ${tempDir.name} ${path.join(tempDir.name, 'source')}`;
const args = command.split(' ');
return execFile(results.soffice, args, callback);
let filterParam = filter?.length ? `:${filter}` : "";
let fmt = !(filter ?? "").includes(" ") ? `${format}${filterParam}` : `"${format}${filterParam}"`;
let args = [];
args.push(`-env:UserInstallation=${url.pathToFileURL(installDir.name)}`);
args.push('--headless');
args.push('--convert-to');
args.push(fmt);
args.push('--outdir');
args.push(tempDir.name);
args.push(path.join(tempDir.name, 'source'));
return execFile(results.soffice, args, execOptions, callback);
}],

@@ -64,11 +70,9 @@ loadDestination: ['convert', (results, callback) =>

]
}, (err, res) => {
}).then( (res) => {
return callback(null, res.loadDestination);
}).catch( (err) => {
return callback(err);
}).finally( () => {
tempDir.removeCallback();
installDir.removeCallback();
if (err) {
return callback(err);
}
return callback(null, res.loadDestination);
});

@@ -75,0 +79,0 @@ };

{
"name": "libreoffice-convert",
"version": "1.4.1",
"version": "1.5.0",
"description": "A simple and fast node.js module for converting office documents to different formats",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc