Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
3
var
imageSize = require(
'image-size'
);
4
5
function
convertToBase64(buffer, mimetype) {
6
return
'data:'
+ mimetype +
';base64,'
+ buffer.toString(
'base64'
);
7
}
8
9
function
fileApi() {
10
return
function
(req, res, next) {
Callers
1
fileApi
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected