1.0.2 • Published 9 years ago
image-base64 v1.0.2
image-base64
Convert image to Base64 format
Installation:
npm install image-base64 --saveUsage:
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)
pathstring, local picture address
url(path,fn)
pathstring, remote picture addressfncallback function after getting data