UNPKG

@johnbillion/ghsvg

Version:

Create an SVG of your GitHub Sponsors

27 lines (23 loc) 772 B
import * as fs from 'fs'; import * as dotenv from 'dotenv'; import * as options from './options.js'; import * as gs from './ghs.js'; import * as svg from './svg.js'; dotenv.config(); export async function run(): Promise<void> { const ghsOptions: Record<string, any> = await options.getOptions( process.argv ); const ignore: Set<string> = new Set(ghsOptions.ignore || []); const data = [ ...(await gs.getGithubSponsors(ghsOptions)), ...(await gs.getOtherSponsors(ghsOptions.otherSponsors)) ].filter((sponsor: Record<string, any>) => !ignore.has(sponsor.login)); fs.writeFileSync(ghsOptions.outFile, await svg.createSVG(data, ghsOptions)); } // call the run function (async () => { await run(); })().catch(error => { console.error(error); });