json-encode-cycles
replaces circluar references in objects with jsonpaths.
usage
import {encodeCycles} from 'json-encode';
encodeCycles(obj);
alternatively you can extend the functionality of the JSON object itself:
require('json-encode').install();
JSON.encodeCycles(obj);