lib/githubAuthentication.js
function createTokenFile(token, tokenFile) {
  return new Promise((resolve, reject) => {
    fs.writeFile(tokenFile, token, (err) => {
      if (err) {
        reject(err);
      }
      resolve(token);
    });
  });
}
function createTokenFile(token, tokenFile) {
  return new Promise((resolve, reject) => {
    fs.writeFile(tokenFile, token, (err) => {
      if (err) {
        reject(err);
      }
      resolve(token);
    });
  });
}
function createTokenFile ( token , tokenFile ) { return new Promise ( ( resolve , reject ) => { fs . writeFile ( tokenFile , token , ( err ) => { if ( err ) { reject ( err ) ; } resolve ( token ) ; } ) ; } ) ; }
Write a token to a given file.
@param  {String} token     The token to save to a file
@param  {String} tokenFile Name of the file to create
@return {Promise}          Resolves back the token that was passed in
Write a token to a given file .