heroku / heroku-cli-command
1
import * as fs from 'fs'
2
import {promisify} from 'util'
3

4
let _debug: any
5
function debug(...args: any[]) {
6 3
  if (_debug) _debug = require('debug')('@heroku-cli/command:file')
7 0
  _debug(...args)
8
}
9

10
export function exists(f: string): Promise<boolean> {
11
  // tslint:disable-next-line
12 0
  return promisify(fs.exists)(f)
13
}
14

15
export function readdir(f: string): Promise<string[]> {
16 0
  debug('readdir', f)
17 0
  return promisify(fs.readdir)(f)
18
}
19

20
export function readFile(f: string) {
21 0
  debug('readFile', f)
22 0
  return promisify(fs.readFile)(f)
23
}

Read our documentation on viewing source code .

Loading