Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

image-base64

chenqf123ISC1.0.2

Convert image to Base64 format

base64, imageBase64, image-to-base64

readme

image-base64

Convert image to Base64 format

Installation:

npm install image-base64 --save

Usage:

var imageBase64 = require('image-base64');
//Local image
imageBase64.local('./image/xxx.jpg');
//Remote image
imageBase64.url('http://xxxx.xxx.xx/image/xxx.jpg',function(base64){
    console.log(base64)
})

API:

local(path)

  • path string, local picture address

url(path,fn)

  • path string, remote picture address
  • fn callback function after getting data