libreoffice-convert
Advanced tools
Comparing version 1.0.4 to 1.0.5
12
index.js
@@ -52,9 +52,7 @@ 'use strict'; | ||
loadDestination: ['convert', (results, callback) => | ||
fs.readFile(path.join(results.tempDir, `source.${format}`), (err, destination) => { | ||
if (err) { | ||
return callback(err); | ||
} | ||
return callback(null, destination); | ||
})], | ||
async.retry({ | ||
times: 3, | ||
interval: 200 | ||
}, (callback) => fs.readFile(path.join(results.tempDir, `source.${format}`), callback), callback) | ||
] | ||
}, (err, res) => { | ||
@@ -61,0 +59,0 @@ temp.cleanup(); |
{ | ||
"name": "libreoffice-convert", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A simple and fast node.js module for converting office documents to different formats", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var _jest = require('jest'), | ||
_fs = require('fs'), | ||
_path = require('path'), | ||
{ exec } = require('child_process'), | ||
convert = require('../index').convert; | ||
@@ -22,2 +23,13 @@ | ||
}); | ||
it('if an another instance of soffice exists, should convert a word document to text', (done) => { | ||
exec("soffice --headless") | ||
// this command create an instance of soffice. This instance will get a failure "Error: source file could not be loaded" | ||
// but only after we ask a new convert. So this is enought to reproduce fail when an another instance is open | ||
setTimeout(()=> { | ||
const docx = _fs.readFileSync(_path.join(__dirname, '/resources/hello.docx')); | ||
convert(docx, 'txt', undefined, expectHello(done)); | ||
}, 100); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89
16894
5
2