files: File[] | FileList
): Promise<string[]>
getDataURLs(An async function that gets an array of data URLs generated from files
.
Example
<!-- In the html, get array of Files from a file input and pass it to
a function:
-->
<p>Choose files to generate data urls from:</p>
<input type="file" multiple (change)="addToURLs($event.target.files)"/>
// In a javascript component:
async addToURLs(files) {
let urls = await getDataURLs(files);
this.dataURLs.push(...urls);
}
Installation
npm i @writetome51/get-data-urls
Loading
import {getDataURLs} from '@writetome51/get-data-urls';