UNPKG

@sap-ux/i18n

Version:
19 lines 604 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.writeFile = writeFile; const fs_1 = require("fs"); /** * Write data to a file. * * @param filePath absolute path to a file * @param content content to write * @param fs optional `mem-fs-editor` instance. If provided, `write` api of `mem-fs-editor` is used. * @returns string or void */ async function writeFile(filePath, content, fs) { if (fs) { return fs.write(filePath, content); } return fs_1.promises.writeFile(filePath, content, { encoding: 'utf8' }); } //# sourceMappingURL=write.js.map