From ad794b956a6c67e2e903d095a66455d512b004b7 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 28 May 2023 19:07:47 +0100 Subject: Document that read methods return promises --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb3d937..d188c0f 100644 --- a/README.md +++ b/README.md @@ -482,15 +482,18 @@ and has the following properties: * `contentType`: the content type of the image, such as `image/png`. * `readAsArrayBuffer()`: read the image file as an `ArrayBuffer`. + Returns a promise of an `ArrayBuffer`. * `readAsBuffer()`: read the image file as a `Buffer`. + Returns a promise of a `Buffer`. This is not supported in browsers unless a `Buffer` polyfill has been used. * `readAsBase64String()`: read the image file as a base64-encoded string. + Returns a promise of a `string`. * `read([encoding])` (deprecated): read the image file with the specified encoding. - If an encoding is specified, a `string` is returned. - If no encoding is specified, a `Buffer` is returned. + If an encoding is specified, a promise of a `string` is returned. + If no encoding is specified, a promise of a `Buffer` is returned. `func` should return an object (or a promise of an object) of attributes for the `` element. At a minimum, this should include the `src` attribute. -- cgit v1.2.3