# Docs

## 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

```bash
npm i print-file # -g if you want a global CLI command, may require prepending sudo
```

## API Example

```javascript
const print = require('print-file')

print({ includeName:true })
```

### Parameters

<table><thead><tr><th>Name</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>options</td><td>Options object</td><td>object</td><td>false</td></tr><tr><td>options.includeName</td><td>Inculde file name at top of page</td><td>bool</td><td>false</td></tr><tr><td>options.file</td><td>File to print. If omitted, it will print the file the function is called from.</td><td>string</td><td>false</td></tr><tr><td>options.portOverride</td><td>Run printer on custom port. Defaults to <code>9991</code>.</td><td>number</td><td>false</td></tr></tbody></table>

## CLI

```bash
pf './file' includeName
```

### Parameters

<table><thead><tr><th>Name</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>file</td><td>The file to print</td><td>string</td><td>true</td></tr><tr><td>includeName</td><td>Inculde file name at top of page</td><td>bool</td><td>false</td></tr></tbody></table>
