我正在尝试使用Google Play抓取工具,并且需要使用NodeJS编写的所有appId的完整列表。我的问题是它仅提供console.log的输出。我需要将其保存为JSON,然后转换为CSV。您知道如何将其保存到JSON吗?我是NodeJS的新手。
var gplay = require('google-play-scraper');
var fs = require('fs');
gplay.list({
category: gplay.category.GAME_actION,collection: gplay.collection.TOP_FREE,num: 2
})
.then(function(apps){
fs.writeFileSync('myjsonfile.json',console.log);
})
.catch(function(e){
console.log('There was an error fetching the list!');
});