import * as fs from "fs" ; import * as fs_async from "async-file" ; import { injectable } from "inversify" ; @ injectable ( ) export class FsProxy { public readFileAsync ( filename , options ? ) { return fs_async . readFile ( filename , options ) ; } public existsAsync ( path ) { return fs_async . exists ( path ) ; } public writeFileAsync ( filename , data , options ? ) { return fs_async . writeFile ( filename , data , options ) ; } public mkdirAsync ( path , mode ? ) { return fs_async . mkdir ( path , mode ) ; } public createReadStream ( path , options ? ) { return fs . createReadStream ( path , options ) ; } public getFileSize ( fileName ) { const stats = fs . statSync ( fileName ) ; return stats . size ; } public readdirAsync ( path ) { return fs_async . readdir ( path ) ; } }