Skip to content

kodegrenade/referral-code-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Referral Code Generator

npm (scoped) npm (scoped)

A package that helps you generate referral code for your users.

Installation

$ npm install referral-code-generator

Features

* Little and easy to use.
* Generate random and custom referral code.

Usage

import referralCodeGenerator from 'referral-code-generator'

OR

let referralCodeGenerator = require('referral-code-generator')

Generating your referral code

example 1: 

referralCodeGenerator.alpha('lowercase', 12)

result: the above code will return 12 random alphabets in lowercase.
example 2: 

referralCodeGenerator.alphaNumeric('uppercase', 8, 7)

result: the above code will return 8 alphabets and 7 numbers respectively.
example 3: 

referralCodeGenerator.custom('lowercase', 6, 6, 'temitope');

result: the above code will return 6 letters from the supplied username and 6 random numbers.

Parameters

username: This is your user's unique name.

wordlength: The number of alphabets you want to extract from the username to form the referral code.

numberlength: The number of random digits you want to generate.

type: The word case format you want. [uppercase, lowercase].

Releases

No releases published

Packages

No packages published