@scaleway/use-random-name

1.0.0 • Public • Published

@scaleway/random-name

A tiny utility to generate random names

Fully inspired by Moby name generator


Install

$ pnpm add @scaleway/use-random-name

Usage

As a React hook

import React from 'react'
import useRandomName from '@scaleway/random-name'

const Component = () => {
  const name = useRandomName()

  return <span>{name}</span>
}

You can also access the underlying @scaleway/random-name package with a named export

import { randomName } from '@scaleway/use-random-name'

// randomName(prefix: string = '', separator: string = '-'): string

randomName() // => "admiring-allen"
randomName('superb') // => "superb-admiring-allen"
randomName('superb', '_') // => "superb_admiring_allen"
randomName('', '_') // => "admiring_allen"

Readme

Keywords

none

Package Sidebar

Install

npm i @scaleway/use-random-name

Weekly Downloads

1,368

Version

1.0.0

License

MIT

Unpacked Size

8.68 kB

Total Files

7

Last publish

Collaborators

  • codelax
  • quantumsheep
  • scaleway-bot
  • mprost
  • imanu
  • vincentaudebert
  • maliszewskid
  • phiphi