An open API service indexing awesome lists of open source software.

https://github.com/writetome51/get-data-urls

Async function that returns data URLs representing each File from a passed array of Files
https://github.com/writetome51/get-data-urls

async data-url javascript typescript

Last synced: 3 months ago
JSON representation

Async function that returns data URLs representing each File from a passed array of Files

Awesome Lists containing this project

README

        

# getDataURLs(
      files: File[] | FileList
): Promise

An async function that gets an array of data URLs generated from `files`.

## Example

```html

Choose files to generate data urls from:

```

```ts
// In a javascript component:

async addToURLs(files) {
let urls = await getDataURLs(files);
this.dataURLs.push(...urls);
}
```

## Installation

```bash
npm i @writetome51/get-data-urls
```

## Loading
```js
import {getDataURLs} from '@writetome51/get-data-urls';
```