File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 1- import fs from 'fs'
2-
3- import { promisify } from 'util'
4-
5- const fsAccessAsync = promisify ( fs . access )
6- const fsChmodAsync = promisify ( fs . chmod )
7- const fsCopyFileAsync = promisify ( fs . copyFile )
8- const fsSymlink = promisify ( fs . symlink )
1+ import fs , { promises as fsPromises } from 'fs'
92
103export const checkAccess = ( { target } ) =>
11- fsAccessAsync ( target , fs . constants . R_OK )
4+ fsPromises . access ( target , fs . constants . R_OK )
125
13- export const chmod = ( { mode, target } ) => fsChmodAsync ( target , mode )
6+ export const chmod = ( { mode, target } ) => fsPromises . chmod ( target , mode )
147
158export const copyFile = ( { source, destination } ) =>
16- fsCopyFileAsync ( source , destination )
9+ fsPromises . copyFile ( source , destination )
1710
1811export const makeSymlink = ( { source, destination } ) =>
19- fsSymlink ( destination , source )
12+ fsPromises . symlink ( destination , source )
You can’t perform that action at this time.
0 commit comments