Miss any of our Open RFC calls?Watch the recordings here! »

image2uri

1.0.4 • Public • Published

Image To URI

image2uri test npm version

Convert image file to data URI. Support .png,.gif,.jpg,.jpeg,.bm,.bmp,.webp,.ico,.svg.

Install

npm i image2uri

Basic Usage

import image2uri from "image2uri";
 
console.log(image2uri('./example.bmp'));
// data:image/bmp;base64,Qk0YCAAAAAAAADYAAAAoAAAAGAAAABwAAAABABgAAAAAAOIHAAA....
console.log(image2uri('./example.jpg'));
// data:image/jpeg;base64,Qk0YCAAAAAAAADYAAAAoAAAAGAAAABwAAAABABgAAAAAAOIHAAA....

Development

npm run watch # Listen compile .ts files. 
npm run build # compile .ts files. 
 
npm run start

Install

npm i image2uri

DownloadsWeekly Downloads

282

Version

1.0.4

License

MIT

Unpacked Size

6.59 kB

Total Files

7

Last publish

Collaborators

  • avatar