Skip to content

Transform file from local or network to base64 string data

Notifications You must be signed in to change notification settings

vanessasoutoc/to-base64

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Transform file from local or network to base64 string data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%