Using 'get' from 'request-promise' doesn't work

I’m trying to upload a pdf file into buffer. I was expecting to get in the console message either ‘get’ or ‘not’, but I get the message ‘undefined’…
In page code:

PDF_name = “https://ff4066b3-fa1e-4f83-866c-5d6548bfdbe3.usrfiles.com/ugd/ff4066_85749710b488467f98302a1ec22f8708.pdf” ;
export function btnUploadPDF_click(event) {

FillPDF( PDF_name , 'fields' ).then(msg =>{ 
    console.log(msg); 
}) 
. catch (error => { 
    console.log( 'error' ); 
}); 

}

In the backend file:
import rp from ‘request-promise’ ;
export function FillPDF (name, fields)
{
rp.get({ URL_path, encoding: null })
.then( (pdf_buf) => {
return ( ‘get’ );
// var out_buf = pdfform().transform(pdf_buf, fields); // next step will be fill the pdf file…
// uploadPDF( out_buf); Step after will be to upload the filled pdf file to UploadFolder…
})
. catch ( (err) => { return ( ‘not’ )})
}

You forgot to write return before the rp.get() function.

Also the request-promise npm got deprecated and you’re better use other solutions.

See:

Thank you J.D, I thought that if the ‘return’ is after ‘get->then’ function , I’ll get the message only if the ‘get’ function executed.
Do you have a recommendations for me what to use instead of reques-promis?

@osnat_po I don’t really know what exactly you’re trying to do. So I can’t recommend.
Anyway, maybe you’ll be interested in buffer npm, blob npm or pdf-generator-api .