Skip to content

Tag: node.js

Alternative for Promise.allSettled

I am currently using Promise.allSettled to wait for all my promises to finish(irrespective of whether they resolve or get rejected). Since my project is compliant to Node v12.3.1 I am unable to use this? What other simple alternatives can I use. Sample code: Note: Promise.allSettled is available from Node ver…

How to attach image at first page in docx file nodejs?

Now I want to implement a functionality to add QR code image at the first page of an existing docx file in nodejs. I’ve tried these three methods but not able to solve. I tried with docx package, but it only allows to build docx file from scratch. I tried with docxtemplater, but it only allows to replac…

Why does Buffer.from(‘x80’, ‘utf8’) return

Why does this happen and how do I get Buffer to behave how I expect and return a <Buffer 80> instead? Answer This happens because 0x80 or 1000 0000 in binary or 128 in decimal is not a valid code point in UTF-8 because it is outside of ASCII (which is 7 bits, so all ASCII code points have the

what is this request response format?

i’m trying to scrape a website but the thing is that i get this as a response (most likely javascript ? ). I am using request in order to send requests to the website. Is it possible to convert it to a parsable format ? I thought of using jQuery to send request an accept a certain response format.But as