@sap-ux/i18n
Version:
Library for i18n
16 lines • 506 B
JavaScript
import { promises } from 'node: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
*/
export async function writeFile(filePath, content, fs) {
if (fs) {
return fs.write(filePath, content);
}
return promises.writeFile(filePath, content, { encoding: 'utf8' });
}
//# sourceMappingURL=write.js.map