Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created August 10, 2017 14:03
Show Gist options
  • Save amandeepmittal/15a3d9b83a95ef426b05ddca19dbb374 to your computer and use it in GitHub Desktop.
Save amandeepmittal/15a3d9b83a95ef426b05ddca19dbb374 to your computer and use it in GitHub Desktop.
let bufferOne = Buffer.from('This is a buffer example.');
console.log(bufferOne);
// Output: <Buffer 54 68 69 73 20 69 73 20 61 20 62 75 66 66 65 72 20 65 78 61 6d 70 6c 65 2e>
let json = JSON.stringify(bufferOne);
console.log(json);
// Output: {"type":"Buffer","data":[84,104,105,115,32,105,115,32,97,32,98,117,102,102,101,114,32,101,120,97,109,112,108,101,46]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment