0.1.1 • Published 5 years ago

radom v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Radom

Radom (not random) is simple random string generator.

Installation

npm install radom

Usage

Radom is a function which returns random string.

const radom = require('radom');
const randomString = radom(); // returns random string

By default returns 5-character string. You can change it by passing a positive number as argument.

const radom = require('radom');
const randomString = radom(7); // now the string should have 7 characters

Radom uses letters, numbers and some special characters (!@#$%^&*) to generate string. You can change it by passing as argument object with config.

Options

You can pass as argument number, to change generated string length, or config object to change some other options.

const radom = require('radom');
const randomString = radom({
  length: 4,
  useLowercase: false
});

Options list

OptionDefaultDescription
length5Length of generated string.
useLetterstrueDetermines if letters can be used to generate string. It's always true if you set both useNumbers and useSpecials to false.
useNumberstrueDetermines if numbers can be used to generate string.
useSpecialstrueDetermines if special characters (range: !@#$%^&*) can be used to generate string.
useLowercasetrueDetermines if lowercase letters can be used to generate string (useLetters must be true). If useLetters is true, but somehow you decided to set both useLowercase and useUppercase to false, then radom will use only lowercase letters anyway.
useUppercasetrueDetermines if uppercase letters can be used to generate string (useLetters must be true).

WTF is Radom?

It's a city in Poland - https://en.wikipedia.org/wiki/Radom