Socket
Book a DemoInstallSign in
Socket

codes-generator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

codes-generator

An NPM package for generating random codes

1.1.1
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Codes Generator

An NPM package for generating random codes

Getting started

  • Install the package
npm install codes-generator
  • Import the generate function from the installed package
const { generate } = require("codes-generator");
  • Use the function
console.log(
  generate(10, {
    upperLetters: true,
    lowerLetters: true,
    numbers: true,
    symbols: false,
  })
);

Function options

KeyValue typeDescriptionDefault valueOptional?
lengthNumberThe length of the code10Yes
upperLettersBooleanInclude uppercase letters in the codetrueYes
lowerLettersBooleanInclude lowercase letters in the codetrueYes
numbersBooleanInclude numbers in the codetrueYes
symbolsBooleanInclude symbols in the codefalseYes

Example

const { generate } = require("codes-generator");

console.log(
  generate(20, {
    lowerLetters: false,
    upperLetters: true,
    numbers: false,
    symbols: true,
  }) // Returns a string of 20 characters containing uppercase letters and symbols
);

Keywords

codes-generator

FAQs

Package last updated on 07 Jan 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.