Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

Node.js buffer toJSON() Method

❮ Buffer Module


Example

Return the buffer object as a JSON object:

var buf = Buffer.from('abc');

console.log(buf.toJSON());
Run example »

Definition and Usage

The toJSON() method returns a JSON object based on the Buffer object.


Syntax

buffer.toJSON();

 Technical Details

Return Value: A JSON object
Node.js Version: 0.9.2

❮ Buffer Module