MCPcopy Index your code
hub / github.com/mailru/FileAPI / convertToBase64

Function convertToBase64

node/file-api.js:5–7  ·  view source on GitHub ↗
(buffer, mimetype)

Source from the content-addressed store, hash-verified

3var imageSize = require('image-size');
4
5function convertToBase64(buffer, mimetype) {
6 return 'data:' + mimetype + ';base64,' + buffer.toString('base64');
7}
8
9function fileApi() {
10 return function (req, res, next) {

Callers 1

fileApiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected