른록노트

[NodeJs] Convert a JSON Object to Buffer and Buffer to JSON Object back 본문

Web/[NodeJs]

[NodeJs] Convert a JSON Object to Buffer and Buffer to JSON Object back

른록 2018. 8. 13. 14:22

@ 설명


zookeeper에는 buffer로 데이터를 저장하는데 json을 buffer로 바꾸는 방법


var obj = {

test : "test"

};


var data = Buffer. from(JSON.stringify(obj));


참고사이트

https://stackoverflow.com/questions/41951307/convert-a-json-object-to-buffer-and-buffer-to-json-object-back

반응형
Comments