📜  robux - TypeScript (1)

📅  最后修改于: 2023-12-03 15:34:44.351000             🧑  作者: Mango

Robux - TypeScript

Robux is a TypeScript library for generating random strings.

Installation
npm install robux --save
Usage
import { Robux } from 'robux';

const robux = new Robux();

// Generate a random string with default length
console.log(robux.generate()); // "Kt1Mf5JW3"

// Generate a random string with custom length
console.log(robux.generate(8)); // "P4yV7LhG"

// Generate a random string with custom characters
console.log(robux.generate(10, '1234567890')); // "8649570926"
API
generate([length: number = 9, characters: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'])

Generate a random string.

  • length: The length of the generated string. Defaults to 9.
  • characters: The characters to use for generating the string. Defaults to all uppercase and lowercase letters and digits.

Returns a randomly generated string.

License

This project is licensed under the MIT License. See the LICENSE file for details.