Skip to content

yasintuncel/randomstring-yt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Random String

Simple, random string generator

Installation

$npm i randomstring-yt

Features

  • Lower characters
  • Upper characters
  • Numbers
  • Customizable special characters
  • Repeatable or not, special characters

default.js

default options

const defaults = {
    lowersCount: 3,
    uppersCount: 3,
    numbersCount: 3,
    specialsCount: 1,
    specials: '_',
    canSpecialRepeat: true
};

usage

const randomstring = require("randomstring-yt");

const rs = randomstring();

console.log(rs);
// 10 characters
// output: x4I_Op03sI

optional.js

const randomstring = require("randomstring-yt");

const rs = randomstring({
    lowersCount: 4,
    uppersCount: 2,
    numbersCount: 2,
    specialsCount: 2,
    specials: '_-!.'
});

console.log(rs);
// output: Yw-W6o_hZ4q

specialnotrepeat.js

const randomstring = require("randomstring-yt");

const rs = randomstring({
    specialsCount: 4,
    canSpecialRepeat: false,
    specials: '_-!.'
});

console.log(rs);
// output: 4-d13.M_gDz!Z

|NOTE| if all options are set to 0 then the output will be 'yoo'

License

MIT

About

Simple, random string generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published