dbashford/textract

Callback parameter will called twice

mirkods opened this issue · 3 comments

Hi there,
and congratulations for this great module.

I discovered that when the url is not correct the callback is executed twice, this is a code to reproduce what I said:

textract.fromUrl('http://google.com/test.pd', (error, text) => {
    console.log(err);
})

The output of this code will be:

- Response code 404 (Not Found)
- Error for type: [[ application/octet-stream ]], file: [[ /var/folders/_5/1yy3l2ms1kl55cv30v02hldh0000gn/T/65561007942.pd ]]

Hope that the issue is clear,
Mirko

Will take a look at this hopefully today, thanks for reporting!

Fixed and released as v2.1.1

awesome, thanks 👍