@peterweglo/randomid-generator
v1.0.1
Published
## Introduction `@peterweglo/randomid-generator` is a lightweight, easy-to-use npm package for generating random IDs. Ideal for instances where a quick, random, alphanumeric string of a specific length is needed.
Downloads
3
Readme
@peterweglo/randomID Generator
Introduction
@peterweglo/randomid-generator
is a lightweight, easy-to-use npm package for generating random IDs. Ideal for instances where a quick, random, alphanumeric string of a specific length is needed.
Installation
To install the package, run the following command in your terminal:
npm install @peterweglo/randomid-generator
Usage
After installation, the randomID
function can be easily imported into your project. Here's a basic example demonstrating how to use it:
const randomID = require('@peterweglo/randomid-generator');
// Generate a random ID of length 10
const myRandomID = randomID(10);
console.log(myRandomID); // Outputs a random string, e.g., 'B7aT9kL3Pq'
API
The randomID
function accepts a single argument:
idLength
(required): A number that specifies the length of the random ID you want to generate.
The function returns a string composed of random alphanumeric characters (including both uppercase and lowercase letters) and numbers.
Contributing
Your contributions are welcome! Feel free to submit issues, propose new features, or make pull requests to improve this package.
License
This project is licensed under the MIT License.