1 개요[ | ]
- npm circular-json
- CircularJSON.stringify()
- JSON을 문자열로 변환할 때 순환참조 오류를 차단할 수 있음
2 설치[ | ]
Console
Copy
root@zetawiki:~/test# npm install circular-json
circular-json@0.3.1 node_modules/circular-json
3 사용예시[ | ]
Console
Copy
root@zetawiki:~/test# cat test.js
var CircularJSON = require('circular-json');
var obj = {};
obj.child = obj;
console.log( CircularJSON.stringify( obj ) );
Console
Copy
root@zetawiki:~/test# node test.js
{"child":"~"}
4 같이 보기[ | ]
5 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.