diff options
Diffstat (limited to 'packages/sol-compiler/src/utils/fs_wrapper.ts')
-rw-r--r-- | packages/sol-compiler/src/utils/fs_wrapper.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/sol-compiler/src/utils/fs_wrapper.ts b/packages/sol-compiler/src/utils/fs_wrapper.ts new file mode 100644 index 000000000..cc7b06175 --- /dev/null +++ b/packages/sol-compiler/src/utils/fs_wrapper.ts @@ -0,0 +1,13 @@ +import { promisify } from '@0xproject/utils'; +import * as fs from 'fs'; +import * as mkdirp from 'mkdirp'; + +export const fsWrapper = { + readdirAsync: promisify<string[]>(fs.readdir), + readFileAsync: promisify<string>(fs.readFile), + writeFileAsync: promisify<undefined>(fs.writeFile), + mkdirpAsync: promisify<undefined>(mkdirp), + doesPathExistSync: fs.existsSync, + rmdirSync: fs.rmdirSync, + removeFileAsync: promisify<undefined>(fs.unlink), +}; |