index.js
function readFile(filename, enc) {
    return new Promise(function (fulfill, reject) {
        fs.readFile(filename, enc || 'utf8', function (err, res) {
            return err ? reject(err) : fulfill(res);
        });
    });
}
function readFile(filename, enc) {
    return new Promise(function (fulfill, reject) {
        fs.readFile(filename, enc || 'utf8', function (err, res) {
            return err ? reject(err) : fulfill(res);
        });
    });
}
function readFile ( filename , enc ) { return new Promise ( function ( fulfill , reject ) { fs . readFile ( filename , enc || 'utf8' , function ( err , res ) { return err ? reject ( err ) : fulfill ( res ) ; } ) ; } ) ; }
Read the contents of the file filename.
Asynchronous mode
@param {string} filename 文件物理路径
@param {undefined | string} enc 为空返回Buffer类型,'utf8'返回String类型
@returns {promise}
Read the contents of the file filename . Asynchronous mode