Docs
Print a file
How does it work?
Printfile makes a temporary file with the source of the target file in a directory in your home dir (~/printfile
) which will be opened and you will be prompted to print. When you select an option, the file will be deleted.
Install
npm i print-file # -g if you want a global CLI command, may require prepending sudo
API Example
const print = require('print-file')
print({ includeName:true })
Parameters
Name
About
Type
Required
options
Options object
object
options.includeName
Inculde file name at top of page
bool
options.file
File to print. If omitted, it will print the file the function is called from.
string
options.portOverride
Run printer on custom port. Defaults to 9991
.
number
CLI
pf './file' includeName
Parameters
Name
About
Type
Required
file
The file to print
string
includeName
Inculde file name at top of page
bool
Last updated
Was this helpful?