How to use faker.js in typescript?
19,330
You have to import it like:
import * as faker from 'faker';
And use it like:
faker.name.findName()
Author by
piernik
Updated on June 06, 2022Comments
-
piernik almost 2 years
As in topic. I cannot handle it :/ I've installed
npm i faker
and alsonpm i @types/faker --save-dev
my IDE found
fakerStatic.name.findName()
but browser not recognizesfakerStatic
.import 'faker';
does not help.