Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

uniquecodegenerator

geekymayur25MIT1.0.3

The unique-id-generator npm package provides a simple and versatile solution for generating unique identifiers in JavaScript projects. It offers the flexibility to generate IDs consisting of numeric digits or a combination of alphanumeric characters. With

uniqueIdGenerator, generator, mayurspace, geekymayur, idgenerator, codegenerator, npm, id, generator

readme

uniquecodegenerator

npm version license

Overview

The uniquecodegenerator npm package provides a simple and versatile solution for generating unique identifiers in JavaScript projects. It offers the flexibility to generate codes consisting of numeric digits or a combination of alphanumeric characters. With customizable options for specifying code type (numeric or alphanumeric) and length, developers can easily integrate this package to create unique codes tailored to their application's needs.

Installation

You can install the package via npm:

`bash npm install uniquecodegenerator

const UniqueIdGenerator = require('uniquecodegenerator');

// Create an instance of the UniqueIdGenerator const idGenerator = new UniqueIdGenerator();

// Generate a numeric ID with a specified length const numericId1 = idGenerator.generateUniqueId('123', 6);

// Generate another numeric ID with a specified length const numericId2 = idGenerator.generateUniqueId('num', 6);

// Generate an alphanumeric ID with a specified length const alphanumericId = idGenerator.generateUniqueId('abc123', 8);

console.log(numericId1); // Output: "604937" console.log(numericId2); // Output: "892346" console.log(alphanumericId); // Output: "R7bF9tCp"