Socket
Socket
Sign inDemoInstall

node-docx-parser

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-docx-parser - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

5

package.json
{
"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"
}
}

11

src/FilesystemService.js
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 @@

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