We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a0d6ee commit 44543a9Copy full SHA for 44543a9
README.md
@@ -130,6 +130,18 @@ document.getElementById('file-input').onchange = function () {
130
}
131
```
132
133
+With
134
+[async/await](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await)
135
+(requires a modern browser or a code transpiler like
136
+[Babel](https://babeljs.io/) or [TypeScript](https://www.typescriptlang.org/)):
137
+
138
+```js
139
+document.getElementById('file-input').onchange = async function () {
140
+ let data = await loadImage(this.files[0], { maxWidth: 600 })
141
+ document.body.appendChild(data.image)
142
+}
143
+```
144
145
### Image scaling
146
147
It is also possible to use the image scaling functionality directly with an
0 commit comments