New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

html-to-pdf-studio

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-pdf-studio - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

.stylelintignore

8

package.json
{
"name": "html-to-pdf-studio",
"version": "1.2.0",
"version": "1.3.0",
"description": "Converting HTML template to PDF files",

@@ -29,3 +29,3 @@ "main": "src/index.js",

"handlebars": "^4.1.2",
"puppeteer": "~1.10.0"
"puppeteer": "^1.15.0"
},

@@ -38,4 +38,6 @@ "devDependencies": {

"nodemon": "^1.19.0",
"npm-run-all": "^4.1.5"
"npm-run-all": "^4.1.5",
"stylelint": "^10.0.1",
"stylelint-config-recommended": "^2.2.0"
}
}

@@ -22,3 +22,3 @@ # html-to-pdf-studio

Compiling a [handlebars HTML template](./templates/invoice.hbs)
Compiling a [handlebars HTML template](./example/templates/index.html)

@@ -28,11 +28,11 @@ ```javascript

const path = require("path");
const { compileHTML } = require("html-to-pdf-studio");
const { compileHTML, createPDF } = require("html-to-pdf-studio");
const cssPath = path.join(__dirname, "./templates/style.css");
const cssPath = path.join(__dirname, "./example/templates/style.css");
const css = fs.readFileSync(cssPath, "utf8");
const htmlPath = path.join(__dirname, "./templates/invoice.hbs");
const htmlPath = path.join(__dirname, "./example/templates/index.html");
const html = fs.readFileSync(htmlPath, "utf8");
let data = require("./templates/data.json");
let data = require("./example/templates/data.json");
const dataBinding = Object.assign(data, { css });

@@ -50,3 +50,3 @@

const fileName = "invoide.pdf";
const outputPath = path.join(__dirname, "./output");
const outputPath = path.join(__dirname, "./example/output");

@@ -75,3 +75,3 @@ if (!fs.existsSync(outputPath)) fs.mkdirSync(outputPath);

[tranchuong][6] - [html_to_pdf][7]
[tranchuong][5] - [html_to_pdf][6]

@@ -86,4 +86,3 @@ ### License

[4]: https://www.npmjs.com/package/html-to-pdf-studio
[5]: https://dependabot.com
[6]: https://github.com/chuongtrh
[7]: https://github.com/chuongtrh/html_to_pdf
[5]: https://github.com/chuongtrh
[6]: https://github.com/chuongtrh/html_to_pdf

@@ -7,2 +7,3 @@ const puppeteer = require('puppeteer');

* @param {Object} pdfOptions Puppeteer page PDF
* @return {Buffer} PDF Buffer
*/

@@ -18,6 +19,8 @@ const createPDF = async (html, pdfOptions) => {

});
await page.pdf(pdfOptions);
const pdf = await page.pdf(pdfOptions);
await browser.close();
return pdf;
};
module.exports = createPDF;
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