Word
Module to return various types of words.
Adjective
Returns an adjective of random or optionally specified length.
Parameters
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected adjective length. If specified length is unresolvable, returns adjective of a random length. |
Returns: string
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
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected adverb length. If specified length is unresolvable, returns adverb of a random length. |
Returns: string
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
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected conjunction length. If specified length is unresolvable, returns conjunction of a random length. |
Returns: string
faker.word.conjunction(length?: number): string
faker.word.conjunction() // => "instead"
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
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected interjection length. If specified length is unresolvable, returns interjection of a random length. |
Returns: string
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
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected noun length. If specified length is unresolvable, returns noun of a random length. |
Returns: string
faker.word.noun(length?: number): string
faker.word.noun() // => "maybe"
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
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected preposition length. If specified length is unresolvable, returns preposition of a random length. |
Returns: string
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
Name | Type | Default | Description |
---|---|---|---|
length? | number | Expected verb length. If specified length is unresolvable, returns verb of a random length. |
Returns: string
faker.word.verb(length?: number): string
faker.word.verb() // => "mortar"
faker.word.verb() // 'act'
faker.word.verb(5) // 'tinge'
faker.word.verb(100) // 'mess'