node-appwrite
Version:
Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
22 lines (20 loc) • 632 B
JavaScript
import { File } from 'node-fetch-native-with-agent';
import { realpathSync, readFileSync } from 'fs';
// src/inputFile.ts
var InputFile = class {
static fromBuffer(parts, name) {
return new File([parts], name);
}
static fromPath(path, name) {
const realPath = realpathSync(path);
const contents = readFileSync(realPath);
return this.fromBuffer(contents, name);
}
static fromPlainText(content, name) {
const arrayBytes = new TextEncoder().encode(content);
return this.fromBuffer(arrayBytes, name);
}
};
export { InputFile };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=inputFile.mjs.map