【发布时间】:2022-01-07 04:14:01
【问题描述】:
我的问题是我需要查看所有项目。当我运行我的脚本时,我在我的日志中得到了一个对象数组,但它并没有全部显示出来 ... 40541 更多项目 不是预期的,我正在尝试记录所有项目
[
{},
{},
... 40541 more items
]
在我的控制台中运行 npm run start 后,我的 package.json 将所有数据记录到 reportData.log。这是我的 package.json 的脚本部分
"scripts": {
"start": "node --experimental-json-modules reportScript.js > reportData.log"
},
这是我reportScript.js中的代码,已添加伪变量
function getReport() {
axios({
method: 'get',
url: reportEndpoint, //not actual, just pseudo
headers: {
'Content-Type':'application/json',
'Cookie':`sess.jwt=${sessJwt}`, //not actual, just pseudo
'integration-key': `${integrationKey}`//not actual, just pseudo
}
})
.then(response => {
var reportResponse = response.data;
console.log(reportResponse);
})
}
【问题讨论】:
标签: javascript node.js unix axios console