项目作者: VitorLuizC

项目描述 :
Fetch asynchronously an image using it's source and resolve as `HTMLImageElement`.
高级语言: TypeScript
项目地址: git://github.com/VitorLuizC/fetch-img.git
创建时间: 2018-07-21T05:18:17Z
项目社区:https://github.com/VitorLuizC/fetch-img

开源协议:

下载


Fetch IMG

Build Status

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.

  1. npm install fetch-img --save
  2. # Use the command below for Yarn.
  3. yarn add fetch-img

Usage

  1. import fetchIMG from 'fetch-img';
  2. fetchIMG('https://nodejs.org/static/images/logo.svg')
  3. .then((img) => document.body.appendChild(img))
  4. .catch((error) => console.error(error));

License

Released under MIT license.