I want to convert a string that represents a Buffer into a string that is what the Buffer was encoding. For example, if I have the string
var str1 = "hello,there"
And then I convert it to a buffer using Buffer.from()
buf1 = Buffer.from(str1)
<Buffer 68 65 6c 6c 6f 2c 74 68 65 72 65>
Then if I take the String
str2 = "68656c6c6f2c7468657265"
And convert it back to give me EITHER the buffer again:
<Buffer 68 65 6c 6c 6f 2c 74 68 65 72 65>
OR simply just (since you can convert the buffer back to the string with .toString())
"hello,there"