npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

random-string-alphanumeric-generator

v0.12.2

Published

A module that can return various types of random string

Downloads

5,729

Readme

random-string-alphanumeric-generator

A module that can return various types of random string npm version npm npm GitHub Release Date Maintenance

HOW TO INSTALL

npm install random-string-alphanumeric-generator --save

HOW TO USE

var random = require('random-string-alphanumeric-generator');

random.randomAlphanumeric(10, "lowercase") //Returns b2pdk4bv98

random.randomLetters(10, "uppercase") //Returns ABHUISLCHF

METHODS

  • randomAlphanumeric Generates a random string of given length lettersIncluded optional field which can be one of following all (default): Includes uppercase letters lowercase letters and numbers lowercase: Includes lowercase letters and numbers uppercase: Includes uppercase letters and numbers
 random.randomAlphanumeric(10, lowercase) // uhf2m363l1
 random.randomAlphanumeric(10, uppercase) // DG8CXMZ21F
 random.randomAlphanumeric(10) // 5hiry73uV8
  • randomLetters Generates a random string of given length lettersIncluded optional field which can be one of following all (default): Includes uppercase letters lowercase letters and numbers lowercase: Includes lowercase letters and numbers uppercase: Includes uppercase letters and numbers
  random.randomAlphanumeric(10, lowercase) // aqswedfrtg
  random.randomAlphanumeric(10, uppercase) // KINHBGFYRS
  random.randomAlphanumeric(10) // 5hiry73uV8 // KqjfrQNkth
  • randomNumber Generates a random number of given length
  random.randomNumber(10) // 4369739553
  • randomHex Generates a random hex of given length Includes only hex characters i.e [0-9 and a-f]
  random.randomHex(10) // 1dd12084e3
  • randomBinary Generates a random binary string of given length Includes only binary characters i.e [0 and 1]
  random.randomBinary(10) // 1110011111
  • randomOctal Generates a random octal string of given length Includes only octal characters i.e [0-7]
  random.randomOctal(10) // 2350150766
  • customRandomString Generates a random string of given length Includes only characters given in customCharSet
  random.customRandomString(10, abcdef) // eadefcaffb
  • getRandomPassword Generates a random string of given length Includes numbers, small letters, capital letters and special characters Second optional param as minimum number of special characters required
  random.getRandomPassword(10)     // JkCtzL*!Pd
  random.getRandomPassword(10, 2)  // $)FN3A#dP^
  • getRandomPasswordStrict Generates a random string of given length Includes numbers, small letters, capital letters and special characters second optional param as fixed number of special characters required
  random.getRandomPasswordStrict(10, 3) // #TUjLFgdRg
  • getRndFloat Generates random float between min(included) and max(excluded) numbers. Min: Default is 0 Max: Default is 1 Third optional param as number of digits after the decimal point default is 4
  random.getRndFloat(4, 5, 3) // 4.304
  • getRndInteger Returns random integer between min(included) and max(excluded) numbers. Min: Default is 0 Max: Default is 100
  random.getRndInteger(5, 50) // 7
  • getRndBoolean Generates random boolean true or false.
  random.getRndBoolean() // True or False