Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mcnaveen/license-gen

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcnaveen/license-gen

Utility to generate a license key in Node.js projects

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68
decreased by-59.76%
Maintainers
1
Weekly downloads
 
Created
Source

Node License Key Generator

:unicorn: Simple utility to generate a license key in Node.js projects.

License Generator Module

:package: Requirements

  • Node.js 12X LTS or 14X LTS 📦

:sparkles: Installation

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

(or)

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

:pen: Usage

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

:bulb: 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);

:ballot_box_with_check: Example Output

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

:bulb: 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);

:ballot_box_with_check: Output with Specified Pair Length

OKXYT-PE8V5

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

:star2: Example Repo

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

:book: License

  • MIT


:green_heart: Message

No Additional dependencies used.

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

Keywords

FAQs

Package last updated on 11 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc