lib/githubAuthentication.js
function readTokenFile(tokenFile) {
  return new Promise((resolve, reject) => {
    fs.readFile(tokenFile, 'utf8', (err, token) => {
      if (err) {
        reject(err);
      }
      resolve(token.slice(0, 40));
    });
  });
}
function readTokenFile(tokenFile) {
  return new Promise((resolve, reject) => {
    fs.readFile(tokenFile, 'utf8', (err, token) => {
      if (err) {
        reject(err);
      }
      resolve(token.slice(0, 40));
    });
  });
}
function readTokenFile ( tokenFile ) { return new Promise ( ( resolve , reject ) => { fs . readFile ( tokenFile , 'utf8' , ( err , token ) => { if ( err ) { reject ( err ) ; } resolve ( token . slice ( 0 , 40 ) ) ; } ) ; } ) ; }
Read the token string from a file
@param  {String} tokenFile The name of a file to read
@return {Promise}          Resolves to the 40-char token
Read the token string from a file