unique-reffral-code-generator
v1.2.0
Published
A simple and customizable unique reffral code generator.
Maintainers
Readme
🎯 Unique Code Generator
A lightweight and simple npm package to generate unique random codes using Node.js.
📦 Installation
Install the package using your preferred package manager:
Using npm:
npm install unique-code-generatorUsing yarn:
yarn add unique-code-generator🚀 Usage
Once installed, you can use the generateCode function like this:
const { generateCode } = require('unique-code-generator');
// Generate a unique code with 10 characters
const code = generateCode(10);
console.log('Generated Code:', code);🛠️ API Reference
generateCode(length: number): string
Generates a unique alphanumeric code of the specified length.
Parameters:
length(number): The desired length of the generated code.
Returns:
- A
stringcontaining a randomly generated unique code.
💡 Example
const { generateCode } = require('unique-code-generator');
const code = generateCode(8);
console.log('Generated Code:', code); // Example: "X7B9D2QK"📄 License
This project is licensed under the MIT License.
🙌 Contributing
Feel free to fork the repository, make enhancements, and open a pull request. Contributions are welcome!
🧑💻 Author
Created with ❤️ by [Muhammad Rabii]
