@timebutt/face-api.js
Version:
JavaScript API for face detection and face recognition in the browser with tensorflow.js
27 lines • 815 B
JavaScript
export function createFileSystem(fs) {
var requireFsError = '';
if (!fs) {
try {
// Disabled this as it throws runtime errors in Showpad
// fs = require('fs')
}
catch (err) {
requireFsError = err.toString();
}
}
var readFile = fs
? function (filePath) {
return new Promise(function (res, rej) {
fs.readFile(filePath, function (err, buffer) {
return err ? rej(err) : res(buffer);
});
});
}
: function () {
throw new Error("readFile - failed to require fs in nodejs environment with error: ".concat(requireFsError));
};
return {
readFile: readFile
};
}
//# sourceMappingURL=createFileSystem.js.map