nim/tools/gen_fake.ts
2025-04-27 17:14:16 +08:00

13 lines
283 B
TypeScript

import { insert_post, NewPost } from '@/db';
import { faker } from '@faker-js/faker';
for (let i = 0; i < 100; i++) {
let text = faker.string.alpha(20);
let x: NewPost = { image: [], content: text };
let [p_id, p_hash] = await insert_post(x)
console.log(p_id, p_hash)
}