Gathering detailed insights and metrics for @divvit/html-data-to-pdf-utils
Gathering detailed insights and metrics for @divvit/html-data-to-pdf-utils
npm install @divvit/html-data-to-pdf-utils
Typescript
Module System
Min. Node Version
Node Version
NPM Version
61.9
Supply Chain
87.5
Quality
75.6
Maintenance
50
Vulnerability
97.9
License
JavaScript (98.79%)
HTML (1.21%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
2,391
Last Day
1
Last Week
4
Last Month
16
Last Year
167
5 Commits
3 Watching
1 Branches
Minified
Minified + Gzipped
Latest Version
0.6.1
Package Id
@divvit/html-data-to-pdf-utils@0.6.1
Size
4.43 kB
NPM Version
3.10.10
Node Version
6.9.5
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-33.3%
4
Compared to previous week
Last month
33.3%
16
Compared to previous month
Last year
-43.8%
167
Compared to previous year
Simple and lightweight HTML to text conversion using Node and PhantomJS.
npm install @divvit/html-data-to-pdf-utils
The API exposes a single function 'convert'. Using this function, you can input a multitude of settings, which are further specified below:
1var pdf = require('@divvit/html-data-to-pdf-utils'); 2 3pdf.convert(options, function(result) { 4 5 /* Using a buffer and callback */ 6 result.toBuffer(function(returnedBuffer) {}); 7 8 /* Using a readable stream */ 9 var stream = result.toStream(); 10 11 /* Using the temp file path */ 12 var tmpPath = result.getTmpPath(); 13 14 /* Using the file writer and callback */ 15 result.toFile("/path/to/file.pdf", function() {}); 16});
Calling convert() requires an options object, which includes the following definitions:
1{ 2 "html" : "Path to HTML file", 3 "data" : "Json data passer in html file", 4 "css" : "Path to additional CSS file", 5 "js" : "Path to additional JavaScript file", 6 "runnings" : "Path to runnings file. Check further below for explanation.", 7 "paperSize" : "Two ways to do this, see below", 8 "deleteOnAction" : "true/false (Deletes the created temp file once you access it via toBuffer() or toFile())" 9}
Instead of paths, one can also provide properly escaped source code.
Either supply a paper format, orientation and border (this is the default)
1{format: 'A4', orientation: 'portrait', border: '1cm'}
Or supply a page width, height and border.
1{width: '3in', height: '2in', border: '0.5in'}
See link below for accepted units and formats
npm test
Anh Nguyen, Nino Ulsamer, Divvit AB
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More