@patrykbn/randomid-generator

1.0.1 • Public • Published

Random ID Generator

A simple, lightweight JavaScript function to generate random IDs of a specified length. This package is ideal for creating unique identifiers for use in various applications. Installation

You can install the package via npm:

bash

npm install random-id-generator

Usage

First, import the function into your project:

javascript

const randomID = require('random-id-generator');

Then, use the randomID function to generate an ID of your desired length:

javascript

const id = randomID(10); console.log(id); // Example output: 'aZ4b5C7dE2'

API randomID(idLength)

idLength: number - The length of the ID you want to generate.

Returns: A string containing a randomly generated ID of the specified length. Example

javascript

const randomID = require('random-id-generator');

// Generate a random ID of length 8 const id = randomID(8); console.log(id); // Example output: 'a9B3cD2e'

// Generate a random ID of length 16 const id16 = randomID(16); console.log(id16); // Example output: 'F2d1bZ6cT8e9Wq3G'

License

This project is licensed under the MIT License

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.10latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.10
1.0.00

Package Sidebar

Install

npm i @patrykbn/randomid-generator

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

1.77 kB

Total Files

3

Last publish

Collaborators

  • patrykbn