Reputation: 3657
As in topic. I cannot handle it :/
I've installed npm i faker
and also npm i @types/faker --save-dev
my IDE found fakerStatic.name.findName()
but browser not recognizes fakerStatic
.
import 'faker';
does not help.
Upvotes: 22
Views: 35479
Reputation: 711
The documentation now says:
import { faker } from '@faker-js/faker'
If it is to be localized data, the desired locale can also be attached.
import { faker } from '@faker-js/faker/locale/de'
Upvotes: 6
Reputation: 40702
You have to import it like:
import * as faker from 'faker';
And use it like:
faker.name.findName()
Upvotes: 56