Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/sxzz/tsdown-users. Users of tsdown github.com/rolldown/tsdown/discussions/143
Something went wrong. Try again.
tsdown-users data.ts
408 B · 17 lines
TypeScript
at main
123456789101112131415161718import { readdir } from 'node:fs/promises'
export interface Repo { url: string stars: number}
const files = (await readdir('./data')) .filter((file) => file.endsWith('.json')) .toSorted()const filename = files.at(-1)!
export const date: string = filename.split('.', 1)[0]export const { default: data }: { default: Repo[] } = await import( `./data/${filename}`, { with: { type: 'json' } })