Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-random-generator

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-random-generator

Useful Random Generator

  • 1.0.1
  • npm
  • Socket score

Version published
Weekly downloads
13K
increased by6.2%
Maintainers
0
Weekly downloads
 
Created
Source

random-generator-js

You can generate random number, text, password or value that you want with custom length easily.


List of Features

  • Generate a random number (custom length)
  • Generate a random text (custom length)
  • Generate a random password (custom length)
  • Generate a random value (custom length)

Download & Installation

$ npm i random-generator-js

Example Usage

const {generateRandom, generateRandomNumber, generateRandomText, generateRandomPassword} = require('js-random-generator')

const length = 8 // custom length
const characterSet = 'qwerasdfzxcv' // custom character set

const randomNumber = generateRandomNumber(length)
console.log(randomNumber) // output: 10462678

const randomTextOnlyUpper = generateRandomText(length,false) // only upper case characters
console.log(randomTextOnlyUpper) // output: EBLKEWMK

const randomTextWithLower = generateRandomText(length,true) // includes lower case characters
console.log(randomTextWithLower) // output: EPugSiwN

const randomPassword = generateRandomPassword(length)
console.log(randomPassword) // output: y7SHvb_Q

const randomValue = generateRandom(length,characterSet) // you can generate a random value with your custom character set
console.log(randomValue) // output: dcwzavdr

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 20 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc