
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-api-pdf
Advanced tools
Simple utility to create PDF version of Node.js API docs.
$ npm install -g node-api-pdf
One thing: for gnu/linux without a graphical environment install xvfb before
$ sudo apt-get install xvfb # or equivalent
Usage: index [options] [versions...]
Versions:
This is Node.js version. By default it is "current". Also can be "latest", strict version like "7.10.0" or major
version like "7" (it means latest 7.x). And of course you can list versions with space like "current 4 latest"
Options:
-o, --output Output directory (if no configured CWD will be used)
-x, --use-xvfb Use it if run on system without a graphical environment.
Please install "xvfb" before (like "sudo apt-get install xvfb" or equivalent)
-c, --config <customConfigFile> Custom config file (js/json) where listed Node.js versions and render options.
Example available in documentation or check "config.js" file placed in module distr
-h, --help output usage information
Create pdf for installed Node.js version
$ node-api-pdf
..or the same thing but using argument current
$ node-api-pdf current
Now lets create pdf for Node.js versions 9.3.0
$ node-api-pdf 9.3.0
Create pdf for latest 8.x and save to ~/node-docs/
$ node-api-pdf 8 --output ~/node-docs/
If we want pdf for latest Node.js versions and our system has not graphical environment (dont forget install xvfb before)
$ node-api-pdf latest --use-xvfb
One more with multiple versions (latest 6.x and 8.9.3) and custom config file (js or json allowed)
$ node-api-pdf 6 8.9.3 -x --config ~/custom-config.json
What about config file?
So, default config (with comments) is placed in PACKAGE_ROOT/config.js (check it on GitHub).
It has 2 sections: docs and pdfGenerator.
docs has map of versions to create pdf.
pdfGenerator has settings for renderer: out directory, xvfb usage and options for electron-pdf.
Simplified version of config:
module.exports = {
docs: {
7: {
enabled: false
},
8: {
enabled: true
},
latest: {
enabled: false
},
current: {
enabled: true
}
},
pdfGenerator: {
/**
* Directory for created PDF
*/
out: '~/devdocs/',
/**
* Use xvfb-run to execute electron without x-server
*/
xvfb: true,
/**
* https://www.npmjs.com/package/electron-pdf#all-available-options
*/
electronPdf: {
// Can be A3, A4, A5, Legal, Letter, Tabloid or an Object containing height and width in microns
pageSize: 'A5',
}
}
};
MIT
FAQs
Simple utility to create PDF version of Node.js API docs
We found that node-api-pdf 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.