let result = await rp(params); // request-promise
if (result) {
let file= new Buffer(result).toString('base64');
}
let file= new Buffer(stringBase64, 'base64').toString();
fs.writeFile(fileName, file, 'binary', (error) => {
if (error) {
throw error;
}
});