Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
voilab-pdf-table
Advanced tools
PdfKit wrapper that helps to draw informations in simple tables.
node install --save voilab-pdf-table
// in some service
var PdfTable = require('voilab-pdf-table'),
PdfDocument = require('pdfkit');
module.exports = {
create: function () {
var pdf = new PdfDocument({
autoFirstPage: false
}),
table = new PdfTable(pdf, {
bottomMargin: 30
});
table
.addPlugin(new (require('voilab-pdf-table/plugins/fitcolumn'))({
column: 'description'
}))
.setColumnsDefaults({
headerBorder: 'B',
align: 'right'
})
.addColumns([
{
id: 'description',
header: 'Product',
align: 'left'
},
{
id: 'quantity',
header: 'Quantity',
width: 40
},
{
id: 'price',
header: 'Price',
width: 40
},
{
id: 'total',
header: 'Total',
width: 70,
renderer: function (tb, data) {
return 'CHF ' + data.total;
}
}
])
.onPageAdded(function (tb) {
tb.addHeader();
});
pdf.addPage();
table.addBody([
{description: 'Product 1', quantity: 1, price: 20.10, total: 20.10},
{description: 'Product 2', quantity: 4, price: 4.00, total: 16.00},
{description: 'Product 3', quantity: 2, price: 17.85, total: 35.70}
]);
return pdf;
}
};
// with express, in some route
app.get('/some/route', function (req, res, next) {
var pdf = require('some/service').create();
pdf.pipe(res);
pdf.end();
});
This code is released under the MIT License (MIT)
FAQs
PdfKit wrapper that helps to draw informations in simple tables.
The npm package voilab-pdf-table receives a total of 3,874 weekly downloads. As such, voilab-pdf-table popularity was classified as popular.
We found that voilab-pdf-table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.