// credit: gist.vyr.my.id import { getHome, search, watch } from './jf.js' const [cmd, ...args] = process.argv.slice(2) const out = (d) => console.log(JSON.stringify(d, null, 2)) const run = async () => { if (cmd === 'home') return out(await getHome(Number(args[0]) || 1)) if (cmd === 'search') return out(await search(args[0], Number(args[1]) || 1)) if (cmd === 'watch') return out(await watch(args[0])) console.log('usage: vyrjf [args]') } run().catch((e) => console.log(JSON.stringify({ error: e.message }, null, 2)))