import * as fs from 'fs' ; import { TextFile } from '../model/text_file' ; export class FilesystemTextFile implements TextFile { constructor ( private readonly filename ) { } readFileSync ( ) { return fs . readFileSync ( this . filename , { encoding : 'utf8' } ) ; } writeFileSync ( text ) { fs . writeFileSync ( this . filename , text , { encoding : 'utf8' } ) ; } }