json-depth-stream: 深度限制的流式JSON解析器

json-depth-stream是一个流式JSON解析器,与其他解析器不同之处在于它能够跳过嵌套过深的数据。安装npm install json-depth-stream。使用const DepthStream = require('json-depth-stream'); const file = require('fs').createReadStream('/tmp/big.json'); const json = new DepthStream(1 / 期望深度 /); json.on('visit', (path, start, end) => {...});

zip 文件大小:26.92KB