Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitorluizc/fetch-img
Fetch asynchronously an image using it's source and resolve as `HTMLImageElement`.
https://github.com/vitorluizc/fetch-img
async asynchronous ava bili image load-image load-image-asynchronously load-image-url promise typescript
Last synced: 3 months ago
JSON representation
Fetch asynchronously an image using it's source and resolve as `HTMLImageElement`.
- Host: GitHub
- URL: https://github.com/vitorluizc/fetch-img
- Owner: VitorLuizC
- Created: 2018-07-21T05:18:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T13:49:06.000Z (over 6 years ago)
- Last Synced: 2024-08-09T04:51:07.643Z (6 months ago)
- Topics: async, asynchronous, ava, bili, image, load-image, load-image-asynchronously, load-image-url, promise, typescript
- Language: TypeScript
- Homepage:
- Size: 107 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fetch IMG
[![Build Status](https://travis-ci.org/VitorLuizC/fetch-img.svg?branch=master)](https://travis-ci.org/VitorLuizC/fetch-img)
Fetch asynchronously an image using it's source and resolve as `HTMLImageElement`.
## Install
This module is published under NPM registry, so you can install using any Node.js package manager.
```sh
npm install fetch-img --save# Use the command below for Yarn.
yarn add fetch-img
```## Usage
```js
import fetchIMG from 'fetch-img';fetchIMG('https://nodejs.org/static/images/logo.svg')
.then((img) => document.body.appendChild(img))
.catch((error) => console.error(error));
```## License
Released under [MIT license](./LICENSE).