-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use native Promise versions of
fs
functions where possible
- Loading branch information
1 parent
0816bd2
commit cf59952
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import * as fs from 'fs' | ||
import { promises as fsp } from 'fs' | ||
import { promisify } from 'util' | ||
|
||
export const readFile = promisify(fs.readFile) | ||
export const writeFile = promisify(fs.writeFile) | ||
export const copyFile = promisify(fs.copyFile) | ||
export const writeFile = fsp.writeFile | ||
export const copyFile = fsp.copyFile | ||
export const exists = promisify(fs.exists) | ||
export const unlink = promisify(fs.unlink) | ||
export const rename = promisify(fs.rename) | ||
export const mkdir = promisify(fs.mkdir) | ||
export const unlink = fsp.unlink | ||
export const rename = fsp.rename | ||
export const mkdir = fsp.mkdir |