Skip to content
On this page

Word

Module to return various types of words.

adjective

Returns an adjective of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected adjective length. If specified length is unresolvable, returns adjective of a random length.

Returns: string

ts
faker.word.adjective(length?: number): string
faker.word.adjective() // => "muddy"
faker.word.adjective() // 'pungent'
faker.word.adjective(5) // 'slimy'
faker.word.adjective(100) // 'complete'

adverb

Returns an adverb of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected adverb length. If specified length is unresolvable, returns adverb of a random length.

Returns: string

ts
faker.word.adverb(length?: number): string
faker.word.adverb() // => "often"
faker.word.adverb() // 'quarrelsomely'
faker.word.adverb(5) // 'madly'
faker.word.adverb(100) // 'sadly'

conjunction

Returns a conjunction of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected conjunction length. If specified length is unresolvable, returns conjunction of a random length.

Returns: string

ts
faker.word.conjunction(length?: number): string
faker.word.conjunction() // => "provided"
faker.word.conjunction() // 'in order that'
faker.word.conjunction(5) // 'since'
faker.word.conjunction(100) // 'as long as'

interjection

Returns an interjection of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected interjection length. If specified length is unresolvable, returns interjection of a random length.

Returns: string

ts
faker.word.interjection(length?: number): string
faker.word.interjection() // => "ugh"
faker.word.interjection() // 'gah'
faker.word.interjection(5) // 'fooey'
faker.word.interjection(100) // 'yowza'

noun

Returns a noun of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected noun length. If specified length is unresolvable, returns noun of a random length.

Returns: string

ts
faker.word.noun(length?: number): string
faker.word.noun() // => "mayor"
faker.word.noun() // 'external'
faker.word.noun(5) // 'front'
faker.word.noun(100) // 'care'

preposition

Returns a preposition of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected preposition length. If specified length is unresolvable, returns preposition of a random length.

Returns: string

ts
faker.word.preposition(length?: number): string
faker.word.preposition() // => "like"
faker.word.preposition() // 'without'
faker.word.preposition(5) // 'abaft'
faker.word.preposition(100) // 'an'

verb

Returns a verb of random or optionally specified length.

Parameters

NameTypeDefaultDescription
length?number

Expected verb length. If specified length is unresolvable, returns verb of a random length.

Returns: string

ts
faker.word.verb(length?: number): string
faker.word.verb() // => "mortar"
faker.word.verb() // 'act'
faker.word.verb(5) // 'tinge'
faker.word.verb(100) // 'mess'

Released under the MIT License.