Generate fake data with faker.js

Here is a simple one to generate fake data with https://www.npmjs.com/package/@faker-js/faker and save it to clipboard.

Note: Updated to use https://www.npmjs.com/package/@faker-js/faker - @johnlindquist

Open fake in Script Kit

// Menu: Fake
// Description: generate fake data with faker.js
// Author: Jacob Cofman
// Twitter: @jcofman
import "@johnlindquist/kit"
const {faker} = await npm("@faker-js/faker");
function getMethodFakerData(method) {
return Object.keys(faker[method]);
}
const fakerMethods = [
"name",
"address",
"phone",
"internet",
"company",
"image",
"lorem",
"helpers",
"date",
"random",
"finance",
"hacker",
"system",
"commerce",
"database",
"animal",
"git",
"music",
"datatype",
];
const method = await arg("Select-Base-Method:", fakerMethods);
const fakerBaseMethods = getMethodFakerData(method);
const script = await arg("Select-Script:", fakerBaseMethods);
const result = await faker[method][script]();
copy(result);
await arg(result);