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
- Host: GitHub
- URL: https://github.com/writetome51/get-data-urls
- Owner: writetome51
- License: mit
- Created: 2019-06-16T05:24:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T22:42:43.000Z (almost 5 years ago)
- Last Synced: 2025-02-14T22:39:48.627Z (3 months ago)
- Topics: async, data-url, javascript, typescript
- Language: TypeScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# getDataURLs(
files: File[] | FileList
): PromiseAn 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';
```