node-docx-parser
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "node-docx-parser", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A node script which can fill DOCX placeholders and convert to PDFs", | ||
@@ -16,5 +16,4 @@ "bin": { | ||
"jszip": "2", | ||
"minimist": "^1.2.0", | ||
"unoconv": "^0.1.2" | ||
"minimist": "^1.2.0" | ||
} | ||
} |
const ArgumentResolver = require("./ArgumentResolver"); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const converter = require('unoconv'); | ||
const exec = require('child_process').exec; | ||
@@ -24,11 +24,4 @@ class FilesystemService { | ||
convertToPdf() { | ||
converter.convert(path.resolve(process.cwd(), ArgumentResolver.outputFileName()), 'pdf', {}, function (err, buffer) { | ||
this.savePdfFile(buffer); | ||
fs.writeFile('converted.pdf', result); | ||
}); | ||
} | ||
savePdfFile(buffer) { | ||
let newFileName = ArgumentResolver.outputFileName().replace("docx", "pdf"); | ||
return this.saveFile(buffer, newFileName); | ||
exec(`/usr/bin/unoconv -f pdf ${ArgumentResolver.outputFileName()} -o ${newFileName}`); | ||
} | ||
@@ -35,0 +28,0 @@ |
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
4
3976
102
1
- Removedunoconv@^0.1.2
- Removedmime@1.2.11(transitive)
- Removedunderscore@1.4.4(transitive)
- Removedunoconv@0.1.2(transitive)