Faker.js for Visual Studio Code
Generate massive amounts of fake (but realistic) data for testing and development with Faker.js.
Usage
- Type
CTRL+SHIFT+P
for Windows or CMD+SHIFT+P
for MacOS to launch command palette;
- Type
Faker.js: <command>
and press Enter
to run Faker.js method.
Installation
- Type
CTRL+SHIFT+P
for Windows or CMD+SHIFT+P
for MacOS to launch command palette;
- Type
Extensions: Install Extensions
and press Enter
to open marketplace (a.k.a extension view);
- Search
Faker.js
extension and install it.
Locale
- Type
CTRL+SHIFT+P
for Windows or CMD+SHIFT+P
for MacOS to launch command palette;
- Type
Preferences: Open User Settings (JSON)
and press Enter
to open setting.json
file;
- Pick locale:
{
"faker-js.locale": "en"
}
Language
If set to "*", the serialization class will change dynamically depending on a language. Otherwise (if set to a particular language), a fixed serialization class will be used for all languages. If no serialization class was found, then the it will use JavaScript syntax.
{
"faker-js.language": "*"
}
Syntax
These options provide additional control over how to insert data. This can be useful if you use a particular language version or specific code formatting preference. For example, in some versions of ECMAScript, big integer 123n
(as literal) is not allowed, but BigInt(123)
(as object wrapper) is permitted.
JavaScript
{
'faker-js.javascript.bigint.insertMode': {
type: 'string',
enum: ['inline', 'literal', 'wrapper'],
default: 'literal',
description:
'BigInt is inserted as "9007199254740991" in inline mode, as "9007199254740991n" in literal mode, as "BigInt(9007199254740991)" in wrapper mode.',
},
'faker-js.javascript.string.insertMode': {
type: 'string',
enum: ['inline', 'literal'],
default: 'literal',
description: 'String inserted: as ""foobar"" in literal mode, as "foobar" in inline mode.',
},
'faker-js.javascript.string.quotes': {
type: 'string',
enum: ['single', 'double', 'backticks'],
default: 'single',
description: 'Specify string quotes type.',
},
}
Python
{
'faker-js.python.bigint.insertMode': {
type: 'string',
enum: ['inline', 'literal'],
default: 'literal',
description:
'BigInt is inserted as "9007199254740991" in inline mode, as "9007199254740991" in literal mode',
},
'faker-js.python.string.insertMode': {
type: 'string',
enum: ['inline', 'literal'],
default: 'literal',
description: 'String inserted: as ""foobar"" in literal mode, as "foobar" in inline mode.',
},
'faker-js.python.string.quotes': {
type: 'string',
enum: ['double'],
default: 'double',
description: 'Specify string quotes type.',
},
}
Faker.js API
airline.aircraftType
airline.airline
airline.airplane
airline.airport
airline.flightNumber
airline.recordLocator
airline.seat
animal.bear
animal.bird
animal.cat
animal.cetacean
animal.cow
animal.crocodilia
animal.dog
animal.fish
animal.horse
animal.insect
animal.lion
animal.petName
animal.rabbit
animal.rodent
animal.snake
animal.type
book.author
book.format
book.genre
book.publisher
book.series
book.title
color.cmyk
color.colorByCSSColorSpace
color.cssSupportedFunction
color.cssSupportedSpace
color.hsl
color.human
color.hwb
color.lab
color.lch
color.rgb
color.space
commerce.department
commerce.isbn
commerce.price
commerce.product
commerce.productAdjective
commerce.productDescription
commerce.productMaterial
commerce.productName
company.buzzAdjective
company.buzzNoun
company.buzzPhrase
company.buzzVerb
company.catchPhrase
company.catchPhraseAdjective
company.catchPhraseDescriptor
company.catchPhraseNoun
company.name
database.collation
database.column
database.engine
database.mongodbObjectId
database.type
datatype.boolean
date.anytime
date.between
date.betweens
date.birthdate
date.future
date.month
date.past
date.recent
date.soon
date.timeZone
date.weekday
finance.accountName
finance.accountNumber
finance.amount
finance.bic
finance.bitcoinAddress
finance.creditCardCVV
finance.creditCardIssuer
finance.creditCardNumber
finance.currency
finance.currencyCode
finance.currencyName
finance.currencySymbol
finance.ethereumAddress
finance.iban
finance.litecoinAddress
finance.maskedNumber
finance.pin
finance.routingNumber
finance.transactionDescription
finance.transactionType
food.adjective
food.description
food.dish
food.ethnicCategory
food.fruit
food.ingredient
food.meat
food.spice
food.vegetable
git.branch
git.commitDate
git.commitEntry
git.commitMessage
git.commitSha
hacker.abbreviation
hacker.adjective
hacker.ingverb
hacker.noun
hacker.phrase
hacker.verb
helpers.arrayElement
helpers.arrayElements
helpers.enumValue
helpers.fake
helpers.fromRegExp
helpers.maybe
helpers.multiple
helpers.mustache
helpers.objectEntry
helpers.objectKey
helpers.objectValue
helpers.rangeToNumber
helpers.replaceCreditCardSymbols
helpers.replaceSymbols
helpers.shuffle
helpers.slugify
helpers.uniqueArray
helpers.weightedArrayElement
image.avatar
image.avatarGitHub
image.avatarLegacy
image.dataUri
image.url
image.urlLoremFlickr
image.urlPicsumPhotos
image.urlPlaceholder
internet.color
internet.displayName
internet.domainName
internet.domainSuffix
internet.domainWord
internet.email
internet.emoji
internet.exampleEmail
internet.httpMethod
internet.httpStatusCode
internet.ip
internet.ipv4
internet.ipv6
internet.jwt
internet.jwtAlgorithm
internet.mac
internet.password
internet.port
internet.protocol
internet.url
internet.userAgent
internet.username
internet.userName
location.buildingNumber
location.cardinalDirection
location.city
location.continent
location.country
location.countryCode
location.county
location.direction
location.language
location.latitude
location.longitude
location.nearbyGPSCoordinate
location.ordinalDirection
location.secondaryAddress
location.state
location.street
location.streetAddress
location.timeZone
location.zipCode
lorem.lines
lorem.paragraph
lorem.paragraphs
lorem.sentence
lorem.sentences
lorem.slug
lorem.text
lorem.word
lorem.words
music.album
music.artist
music.genre
music.songName
number.bigInt
number.binary
number.float
number.hex
number.int
number.octal
number.romanNumeral
person.bio
person.firstName
person.fullName
person.gender
person.jobArea
person.jobDescriptor
person.jobTitle
person.jobType
person.lastName
person.middleName
person.prefix
person.sex
person.sexType
person.suffix
person.zodiacSign
phone.imei
phone.number
science.chemicalElement
science.unit
string.alpha
string.alphanumeric
string.binary
string.fromCharacters
string.hexadecimal
string.nanoid
string.numeric
string.octal
string.sample
string.symbol
string.ulid
string.uuid
system.commonFileExt
system.commonFileName
system.commonFileType
system.cron
system.directoryPath
system.fileExt
system.fileName
system.filePath
system.fileType
system.mimeType
system.networkInterface
system.semver
vehicle.bicycle
vehicle.color
vehicle.fuel
vehicle.manufacturer
vehicle.model
vehicle.type
vehicle.vehicle
vehicle.vin
vehicle.vrm
word.adjective
word.adverb
word.conjunction
word.interjection
word.noun
word.preposition
word.sample
word.verb
word.words