Narwhals Prolong Mischief
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    to-base64public

    to-base64

    Transform file from local or network to base64 string data

    Installation

    npm install to-base64

    Quick Start

    var toBase64 = require('to-base64');
     
    toBase64('https://github.com/favicon.ico', function (result) {
      console.log(result.base64);
      console.log(result.contentType);
    }, function (error) {
      console.log(error);
    });

    APIs

    toBase64(String path, Function callback, function onError)

    .fromFile(String path, Function callback, Function onError)

    .fromURL(String url, Function callback, Function onError)

    Todo

    • add fromFile support

    License

    MIT

    Keywords

    none

    install

    npm i to-base64

    Downloadsweekly downloads

    10

    version

    1.0.1

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar