Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A node module that is capable of generating pdf reports from HTML templates.
A node module that is capable of generating pdf reports from HTML templates.
pdf-report
was created out of the need to reliably generate PDF reports based off of templated information. There were many other tools out there that did similar jobs to this but had a poor code base; this tool aims to achieve a better code base and more support.
To install pdf-report
, simply run the following command in your terminal (from your project directory):
npm install pdf-report --save
// external dependencies
const PDFReport = require('pdf-report');
const path = require('path');
const fs = require('fs');
// constants/variables
const html = fs.readFileSync(path.join(__dirname, 'template.html')).toString();
const fileName = path.join(__dirname, 'example.pdf');
// logic
report.toFile(fileName)
.then(function(filePath) {
console.log('open', filePath);
})
.catch(function(error) {
console.log('error', error);
});
{
height: '10.5in',
width: '8in',
orientation: 'portrait',
quality: 75,
timeout: 30000,
assetsDirectory: null,
header: {
height: '26mm'
},
footer: {
height: '18mm'
}
}
After the report has been generated, it can be accessed via one of the following methods:
.toFile(pathToSave)
- generates the report and saves it to disk at the specified path.toBuffer()
- generates the report and returns the buffer.toStream()
- generates the report and returns a read stream to the file<style>
tag in your HTML.<header>
tag in your HTML.<footer>
tag in your HTML.FAQs
A node module that is capable of generating pdf reports from HTML templates.
We found that pdf-report demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.