Skip to content

Commit

Permalink
doc: fix example of using isPrintComplete (#22)
Browse files Browse the repository at this point in the history
Fix syntax for isPrintComplete parameter: should be a resolved promise from print function
  • Loading branch information
Ryscho authored Oct 4, 2023
1 parent aa1bc01 commit 033e206
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ print("assets/file.jpg", printer, options).then(console.log);

| Argument | Type | Optional | Description |
| ------------- | :---------------------------------------: | -------- | ------------------------------ |
| printResponse | <code>{stdout: string &#124; null}</code> | Required | Promise returned from [`print`](#printpdf-printer-options--promisevoid). |
| printResponse | <code>{stdout: string &#124; null}</code> | Required | Resolved promise returned from [`print`](#printpdf-printer-options--promisevoid). |

**Returns**

Expand All @@ -113,7 +113,7 @@ print("assets/file.jpg", printer, options).then(console.log);
import { isPrintComplete } from 'unix-print';

const fileToPrint = 'assets/file.pdf';
const printJob = print(fileToPrint);
const printJob = await print(fileToPrint);

async function waitForPrintCompletion(printJob) {
while (!await isPrintComplete(printJob)) {
Expand Down

0 comments on commit 033e206

Please sign in to comment.