code-random

1.1.0 • Public • Published

code-random

Get a random text code for your needs.

Installation

npm

  npm install code-random

yarn

  yarn add code-random

Usage/Examples

import getRandomCode from 'code-random'

const lettersCode = getRandomCode(6, { letters: true }); // arovup

const absoluteRandomCode = getRandomCode(16,
  { letters: true, digits: true, symbols: true },
  true,
); // W$+mj4^/@ri%Z48v

/** 
 * type PatternConfig = {
 *   letters?: boolean;
 *   digits?: boolean;
 *   symbols?: boolean;
 * }
// getRandomCode(length: number, config: PatternConfig, uppercase: boolean)

/code-random/

    Package Sidebar

    Install

    npm i code-random

    Weekly Downloads

    1

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    7.62 kB

    Total Files

    15

    Last publish

    Collaborators

    • haunted_