UNPKG

isomorphic-git

Version:

Node library for interacting with git repositories, circa 2017

12 lines (11 loc) 313 B
import fs from 'fs' // An async readFile variant that returns null instead of throwing errors export default async function read (file, options) { return new Promise(function (resolve, reject) { fs.readFile( file, options, (err, file) => (err ? resolve(null) : resolve(file)) ) }) }