mkmrare/cmd/fetch.ts
2019-11-21 17:06:46 +01:00

15 lines
373 B
TypeScript

import { asyncSaveJSON, CardMarketApi } from "../lib";
async function run() {
if (process.argv.length < 3) {
console.error("Usage: yarn fetch <uid>");
process.exit(1);
return;
}
const uid = process.argv[2];
let api = new CardMarketApi();
const articles = await api.getAllArticles(uid);
await asyncSaveJSON(`${uid}-cards.json`, articles);
}
run();