Skip to content

πŸ¦„ Simple utility to generate a license key in Node.js projects

License

Notifications You must be signed in to change notification settings

mcnaveen/license-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Node License Key Generator

All Contributors

πŸ¦„ Simple utility to generate a license key in Node.js projects.

License Generator Module

πŸ“¦ Requirements

  • Node.js 12X LTS or 14X LTS πŸ“¦

✨ Installation

  • Install the NPM Package with the below command:
npm install @mcnaveen/license-gen --save

(or)

  • Install with Yarn:
yarn add @mcnaveen/license-gen

πŸ–ŠοΈ Usage

  • Import the module in your project:
import generateLicenseKey from "@mcnaveen/license-gen";

πŸ’‘ Example

  • Import the module in your project
  • Pass the length of the license key you want to generate
  • Here I want to generate a license key with 32 characters
import generateLicenseKey from "@mcnaveen/license-gen";

const myKey = generateLicenseKey(32);
console.log(myKey);

β˜‘οΈ Example Output

8J5S-XN5P-73P2-XCPO-R37V-MPTH-TD6F-X270

πŸ’‘ Example with Pair Length

Optionally, You can pass the pair length of the license key as a second argument.

  • Here I want to generate a license key with 10 characters and pair length of 5
import { generateLicenseKey } from '@mcnaveen/license-gen';

const myKey = generateLicenseKey(10, 5);
console.log(myKey);

β˜‘οΈ Output with Specified Pair Length

OKXYT-PE8V5

If the Pair length is not specified, the default pair length will be set to 4.

🌟 Example Repo

https://github.com/mcnaveen/license-gen-example

πŸ“– License

  • MIT

Links:


πŸ’š Message

No Additional dependencies used.

I hope you find this useful. If you have any questions, please create an issue.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Hexmark Records Ltd
Hexmark Records Ltd

πŸ’»
MC Naveen
MC Naveen

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!