anote
1import * as fs from 'fs';
2
3export function getBuffer(str: string) : Buffer {
4return Buffer.from(str);
5}
6
7export function readFile(fileWithPath: string) : string {
8return fs.readFileSync(fileWithPath, 'utf8');
9}
10
11export function writeFile(fileWithPath: string, data: string) {
12fs.writeFileSync(fileWithPath, data);
13}
14
15export function appendFile(fileWithPath: string, data: string) {
16fs.appendFileSync(fileWithPath, data, 'utf8');
17}