@emiljohansson/random-string
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

random-string

Generates a random string.

Install

$ npm install @emiljohansson/random-string

Usage

import randomString from 'random-string'
randomString()
// => '1k59GeX6Nn'

API

randomString(props) => string;

Returns a random string.

length

Type: number

Optional length of the string. Default is 10.

letters

Type: boolean

Includes alphabetical letters in the string. Default is true.

numeric

Type: boolean

Includes numbers in the string. Default is true.

symbols

Type: boolean

Includes special characters in the string. Default is false.

License

MIT © Emil Johansson

Readme

Keywords

Package Sidebar

Install

npm i @emiljohansson/random-string

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

5.27 kB

Total Files

7

Last publish

Collaborators

  • emiljohansson