From 033e2063b683301c0204077458a4bbc2e7c4b47d Mon Sep 17 00:00:00 2001 From: Ryscho <43499659+Ryscho@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:08:10 -0600 Subject: [PATCH] doc: fix example of using isPrintComplete (#22) Fix syntax for isPrintComplete parameter: should be a resolved promise from print function --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17ebcef..af2ff5a 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ print("assets/file.jpg", printer, options).then(console.log); | Argument | Type | Optional | Description | | ------------- | :---------------------------------------: | -------- | ------------------------------ | -| printResponse | {stdout: string | null} | Required | Promise returned from [`print`](#printpdf-printer-options--promisevoid). | +| printResponse | {stdout: string | null} | Required | Resolved promise returned from [`print`](#printpdf-printer-options--promisevoid). | **Returns** @@ -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)) {