UNPKG

@heroku-cli/command

Version:
22 lines (21 loc) 536 B
import debugModule from 'debug'; import * as fs from 'fs'; import { promisify } from 'util'; let _debug; function debug(...args) { if (!_debug) _debug = debugModule('@heroku-cli/command:file'); _debug(...args); } export function exists(f) { // eslint-disable-next-line n/no-deprecated-api return promisify(fs.exists)(f); } export function readdir(f) { debug('readdir', f); return promisify(fs.readdir)(f); } export function readFile(f) { debug('readFile', f); return promisify(fs.readFile)(f); }