Closed quo91 closed 6 years ago
Yes this is possible,
you could the file system node module called fs
heres an example
const OPSkinsAPI = require('@opskins/api');
const opskins = new OPSkinsAPI('');
const fs = require('fs');
opskins.getLowestPrices(578080, function(err, prices) {
console.log("Prices",prices);
fs.writeFile(__dirname + '\\prices.json', JSON.stringify(prices), function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
});
Thank you a million times! This was the last part i needed for my app! 👍
Is is possible to save a local JSON file using the getLowestPrices function? I'm stuck here without an idea: var OPSkinsAPI = require('@opskins/api'); var opskins = new OPSkinsAPI('');
opskins.getLowestPrices(578080, function(err, prices) { console.log("Prices"+prices); });