UNPKG

isomorphic-git

Version:

Node library for interacting with git repositories, circa 2017

11 lines (10 loc) 297 B
import fs from 'fs' // An async exists variant export default async function exists (file, options) { return new Promise(function (resolve, reject) { fs.stat(file, (err, stats) => { if (err) return err.code === 'ENOENT' ? resolve(false) : reject(err) resolve(true) }) }) }