# node-random-string

> To create random string

Latest version **1.0.1** (published 2019-04-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-random-string
pnpm add node-random-string
yarn add node-random-string
bun add node-random-string
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-04-18 |
| First published | 2019-04-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Saravana |
| Maintainers | saravana2107 |
| Keywords | randomstring, random-string, random |

## Links

- npm: https://www.npmjs.com/package/node-random-string
- Repository: https://github.com/saravana2107/node-random-string
- Homepage: https://github.com/saravana2107/node-random-string#readme
- Issues: https://github.com/saravana2107/node-random-string/issues
- npm.io page: https://npm.io/package/node-random-string

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-04-18

## README

# node-random-string

To create a random string.

## Installation

To install node-random-string, use [npm](http://github.com/npm/npm):

```
npm i node-random-string -S
```

## Usage

```javascript
import randomString from 'node-random-string';

randomString();
/* '1Uobd2CVV2mXwc7F7yKCvLRVgUBDH3DB' */

randomString(12);
/* 'uU4u1QyytM4U' */

randomString({
  length: 12,
  charset: 'alphabetic'
});
/* 'nORLfqUfkuxn' */

randomstring({
  chars: 'abc'
});
/* 'bbcaaccbacccccbabacacbacabbcbccb' */

randomString({
  length: 12,
  upperCase: true
});
/* 'FQVI8YMT1D81' */
```

## Options
- `length` - define the length of the string. (default: 32) [OPTIONAL]
- `charset` - define the character set for the string. (default: [0-9 a-z A-Z]) [OPTIONAL]
  - `alphabetic` - [a-z A-Z]
  - `numeric` - [0-9]
- `chars` - define the characters of the string. (default: null) [OPTIONAL]
- `lowerCase` - define whether the output should be lowercase only. (default: null) [OPTIONAL]
- `upperCase` - define whether the output should be uppercase only. (default: null) [OPTIONAL]

## Tests

```
npm install
npm test
```

---
_Source: https://npm.io/package/node-random-string · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
