1.0.0 • Published 4 years ago

@writetome51/get-data-urls v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

getDataURLs(      files: File[] | FileList): Promise<string[]>

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';