From cbdbbb768bf0804087201a4e99302a7dbc848198 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 29 Oct 2024 12:47:25 +0700 Subject: [PATCH] Clarify `add()` return value Fixes #213 --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index bf148e1..ebb3d90 100644 --- a/readme.md +++ b/readme.md @@ -116,7 +116,9 @@ If `true`, specifies that any [pending](https://developer.mozilla.org/en-US/docs #### .add(fn, options?) -Adds a sync or async task to the queue. Always returns a promise. +Adds a sync or async task to the queue. + +Returns a promise with the return value of `fn`. Note: If your items can potentially throw an exception, you must handle those errors from the returned Promise or they may be reported as an unhandled Promise rejection and potentially cause your process to exit immediately.