2.1.1 • Published 2 years ago

fallguys-names v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Fall Guys names

Fully customizable what-three-words generator with a default set of fallguys names.

export type WordModifiers = {
  firsts?: string[]
  seconds?: string[]
  thirds?: string[]
}

export type FGConfig = {
  quantity?: number
  mix?: WordModifiers
  replace?: WordModifiers
  separator?: string
}

function fallguys(args: FGConfig): string | string[]

How to

# Install the package as a dependency
$ yarn add fallguys-names
// In your project, import from 'fallguys-names'
import fallguys, { FGConfig } from 'fallguys-names'

// fallguys-names exports a default function that generates a random what-three-words style string
const myAwesomeNewFallGuysName: string = fallguys() // e.g. "Clever Streaming Knight"

const config: FGConfig = {
  quantity: 2,
}

const myArrayOfNames: string[] = fallguys(config) // e.g. ["Steady Yeeted Climber", "Bonkers Bumbling Monster"]

Configuration options

Optionally you can pass an object as an argument, with any of the following fields:

fieldtyperequireddefault
quantitynumberfalse1
mixObjectfalseundefined
replaceObjectfalseundefined
separatorstringfalsea single space

quantity

The quantity or strings that the function will return. Important! by increasing the quantity to more than one, the function will return an array of names

mix

You may supply your own choice of words to mix with the original words in the library.

replace

You may supply your own choice of words to replace the original words in the library.

separator

The separator character to be used between the words. Defaults to a single space.

fallguys