I've been trying to use the https package to make some API calls, but when it comes to printing the result, it seems that only process.stdout.write()
returns an unformatted JSON body, while console.log()
returns a Buffer:
<Buffer 7b 22 74 6f 6b 65 6e 5f 74 79 70 65 22 3a 22 42 65 61 72 65 72 22 2c 22 65 78 70 69 72 65 73 5f 69 6e 22 3a 33 36 30 30 2c 22 61 63 63 65 73 73 5f 74 ... 808 more bytes>
So my question is, what's the difference between these two functions since NodeJS' documentation is saying that they're almost the same, the only difference being a newline.