cli/download.js
function writeFile(filePath, contents) {
  return new Promise((resolve, reject) => {
    fs.writeFile(filePath, contents, 'utf-8', (err, file) => {
      err ? reject(err) : resolve();
    })
  });
}
function writeFile(filePath, contents) {
  return new Promise((resolve, reject) => {
    fs.writeFile(filePath, contents, 'utf-8', (err, file) => {
      err ? reject(err) : resolve();
    })
  });
}
function writeFile ( filePath , contents ) { return new Promise ( ( resolve , reject ) => { fs . writeFile ( filePath , contents , 'utf-8' , ( err , file ) => { err ? reject ( err ) : resolve ( ) ; } ) } ) ; }
Writes a file to disk.

@param {string} filePath The file path to write to.
@param {string} contents A UTF-8 encoded string of the file contents.
@return {Promise<void>} Resolves when the file has been written successfully.
Writes a file to disk .