import * as fs from "fs" ; import * as util from "util" ; const stat = util . promisify ( fs . stat ) ; param { string } path returns { boolean } export async function isDirectory ( path ) { try { if ( ( await stat ( path ) ) . isDirectory ( ) ) { return true ; } } catch ( reason ) { } return false ; } param { string } path returns { boolean } export async function isFile ( path ) { try { if ( ( await stat ( path ) ) . isFile ( ) ) { return true ; } } catch ( reason ) { } return false ; }