url-conversion-base64

1.0.2 • Public • Published

url-conversion-base64

image url 转换成 base64 image url conversion base64

install

npm install --save url-conversion-base64

use

const urlConversionBase64 = require("url-conversion-base64");
 
let url = `http://dearzoe.coding.me/blogImg/images/touxiang.jpg`;
//参数 string
async function getImageBase64() {
  let base64 = await urlConversionBase64(url);
  console.log(base64);
}
 
// 输出 =>
`data:image/png;base64,iVBORw0KG...`;

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i url-conversion-base64

      Weekly Downloads

      6

      Version

      1.0.2

      License

      ISC

      Unpacked Size

      2.07 kB

      Total Files

      3

      Last publish

      Collaborators

      • dearzoe