You have to import it like:

import * as faker from 'faker';

And use it like:

faker.name.findName()
Answer from Saravana on Stack Overflow
🌐
npm
npmjs.com › package › @types › faker
@types/faker - npm
October 23, 2024 - This is a stub types definition for @types/faker (https://github.com/Marak/Faker.js#readme).
      » npm install @types/faker
    
Published   Oct 23, 2024
Version   6.6.11
Discussions

Feat: Add typescript types for @faker-js/faker
Generate massive amounts of fake data in the browser and node.js - Feat: Add typescript types for @faker-js/faker · Issue #9 · faker-js/faker More on github.com
🌐 github.com
22
January 7, 2022
Is there a library that generates fake data from a typescript interface?
Fakerjs or chance come to mind More on reddit.com
🌐 r/node
37
21
November 10, 2025
🌐
FakerJS
fakerjs.dev › guide › usage
Usage | Faker
It is highly recommended to use version tags when importing libraries in Deno, e.g: import { faker } from "https://esm.sh/@faker-js/faker@v10.4.0". ... We assume that you use TypeScript (strict mode).
🌐
DEV Community
dev.to › sirwanafifi › ts-faker-generating-fake-data-using-typescript-interfaces-2em2
ts-faker - Generating fake data using TypeScript interfaces - DEV Community
July 29, 2021 - You just need to define your schema as TypeScript interfaces, and the test data will be generated automatically. I thought it would be a good idea to share the source code with you so that you can learn something from it. I hope you enjoy it. source: https://github.com/SirwanAfifi/ts-faker website: https://ts-faker.vercel.app/
🌐
GitHub
github.com › magiqans › faker.ts
GitHub - magiqans/faker.ts: Faker typescript decorators
import { Fake, fake } from "faker-ts"; @Fake() class A { @fake("{{name.lastName}}, {{name.firstName}} {{name.suffix}}") name: string; } console.log(new A().name); // outputs: "Marks, Dean Sr."
Starred by 3 users
Forked by 2 users
Languages   TypeScript 100.0% | TypeScript 100.0%
🌐
DEV Community
dev.to › serifcolakel › building-a-typescript-helper-for-mock-data-generation-with-zod-and-faker-4b8f
Building a TypeScript Helper for Mock Data Generation with Zod and Faker - DEV Community
November 5, 2024 - import { ZodSchema, ZodObject, ZodString, ZodNumber, ZodBoolean, ZodArray, ZodOptional, ZodNullable, ZodTypeAny, ZodStringCheck, } from "zod"; import { faker } from "@faker-js/faker"; import { z } from "zod"; const handleStringCheck = (check: ZodStringCheck) => { switch (check.kind) { case "date": return faker.date.recent().toISOString(); case "url": return faker.internet.url(); case "email": return faker.internet.email(); case "uuid": case "cuid": case "nanoid": case "cuid2": case "ulid": return crypto.randomUUID(); case "emoji": return faker.internet.emoji(); default: return faker.lorem.word
🌐
Untitled Publication
noam.hashnode.dev › using-faker-in-typescript
Using faker in typescript - noam honig's blog
January 9, 2022 - import { Remult } from "remult"; import { AccountManager } from "../AccountManagers/AccountManager.entity"; import { name, internet } from 'faker'; export async function generateDataIfEmpty(remult: Remult) { console.log("here"); const repo = remult.repo(AccountManager); if (await repo.count() == 0) { for (let index = 0; index < 10; index++) { const firstName = name.firstName(); const lastName = name.lastName(); await repo.save({ firstName, lastName, email: internet.email(firstName, lastName) }, true) } } }
Find elsewhere
🌐
npm
npmjs.com › package › @faker-js › faker
@faker-js/faker - npm
4 weeks ago - // ESM import { faker } from '@faker-js/faker'; // CJS const { faker } = require('@faker-js/faker'); export function createRandomUser() { return { userId: faker.string.uuid(), username: faker.internet.username(), email: faker.internet.email(), ...
      » npm install @faker-js/faker
    
Published   Mar 23, 2026
Version   10.4.0
🌐
GitHub
github.com › faker-js › faker › issues › 9
Feat: Add typescript types for @faker-js/faker · Issue #9 · faker-js/faker
January 7, 2022 - Generate massive amounts of fake data in the browser and node.js - Feat: Add typescript types for @faker-js/faker · Issue #9 · faker-js/faker
Author   damienwebdev
🌐
Qpercom
qpercom.com › home › tdd: factory generator with factory.ts and faker.js to ease your testing in typescript applications
TDD: Factory generator with factory.ts and faker.js to ease your testing in TypeScript applications - Qpercom
November 27, 2024 - Going back to our example, we can easily generate a list of departments by assigning random data to the properties of the IDepartment interface. There are a ton of libraries that can help to create random data. Notice that id and name properties are generated randomly by the library called faker.js.
🌐
Medium
jaferson123.medium.com › tdd-factory-generator-with-factory-ts-and-faker-js-to-ease-your-testing-in-typescript-applications-5afdd45e6e8
TDD: Factory generator with factory.ts and faker.js to ease your testing in TypeScript applications | by Jose Silva | Medium
April 17, 2019 - Going back to our example, we can easily generate a list of departments by assigning random data to the properties of the IDepartment interface. There are a ton of libraries that help creating random data. ... Notice that id and name properties are generated randomly by the library called faker.js.
🌐
CodeSandbox
codesandbox.io › examples › package › @types › faker
@types/faker examples - CodeSandbox
Use this online @types/faker playground to view and fork @types/faker example apps and templates on CodeSandbox.
🌐
FakerJS
fakerjs.dev › guide
Getting Started | Faker
This documentation only covers the JavaScript implementation of Faker.
🌐
DEV Community
dev.to › matthewmayer › leveling-up-your-custom-fake-data-with-fakerjs-3f7m
Leveling up your custom fake data with Faker.js - DEV Community
January 28, 2024 - Faker.js is a very useful library which lets you generate large amounts of fake data in... Tagged with javascript, faker, typescript, webdev.
🌐
GitHub
github.com › faker-js
faker-js · GitHub
TypeScript 12 3 4 11 Updated · Apr 15, 2026 · playground Public · A playground project to test cjs and esm for js and ts and an additional browser setup · There was an error while loading. Please reload this page. faker-js/playground’s past year of commit activity ·
🌐
GitHub
github.com › cytle › faker-ts
GitHub - cytle/faker-ts: Mock data from TypeScript
Mock data from TypeScript · import { tsMock, tsMockService } from 'faker-ts'; const files = ['foo.ts']; // foo.ts // export interface IFoo { a: string } const mocker = tsMock(files); mocker.generateMock('IFoo'); // { "a": "commodo voluptate pariatur" } // or listening file change const mocker = tsMockService(files); // see more Mock Server with Koa ·
Starred by 32 users
Forked by 7 users
Languages   TypeScript 93.0% | JavaScript 7.0% | TypeScript 93.0% | JavaScript 7.0%
🌐
GitHub
github.com › google › intermock
GitHub - google/intermock: Mocking library to create mock objects with fake data for TypeScript interfaces · GitHub
node ./node_modules/intermock/build/src/cli/index.js --files ./example-file.ts --interfaces "Admin"
Starred by 1.2K users
Forked by 70 users
Languages   TypeScript 92.4% | JavaScript 7.6%
🌐
Sling Academy
slingacademy.com › article › using-fakerjs-in-typescript-a-practical-guide
Using Faker.js in TypeScript: A Practical Guide - Sling Academy
Faker.js, a popular library for generating massive amounts of fake data, joined hands with TypeScript, enables developers to ensure type safety alongside scalability. This guide brings you closer to Faker.js within a TypeScript environment, unveiling practical implementations, type definitions, and examples.