Napoleon's Penguin Mascot

    referral-code-generator

    1.0.8 • Public • Published

    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].
    

    Install

    npm i referral-code-generator

    DownloadsWeekly Downloads

    601

    Version

    1.0.8

    License

    MIT

    Unpacked Size

    15.1 kB

    Total Files

    5

    Last publish

    Collaborators

    • codegrenade