@writetome51/get-data-urls
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @writetome51/get-data-urls

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.13 kB

    Total Files

    5

    Last publish

    Collaborators

    • writetome51