{"id":18799877,"url":"https://github.com/mcnaveen/license-gen","last_synced_at":"2025-07-19T10:02:05.420Z","repository":{"id":103680066,"uuid":"464974726","full_name":"mcnaveen/license-gen","owner":"mcnaveen","description":"🦄 Simple utility to generate a license key in Node.js projects","archived":false,"fork":false,"pushed_at":"2023-03-11T21:18:01.000Z","size":94,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T23:03:30.645Z","etag":null,"topics":["es6-modules","hacktoberfest","license","license-generator","license-key","license-keys","nodejs","nodejs-library","nodejs-modules"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mcnaveen/license-gen","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcnaveen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":"mcnaveen","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/mcnaveen"}},"created_at":"2022-03-01T16:38:02.000Z","updated_at":"2023-10-03T06:17:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"38b3c24f-1525-4b80-8d16-fb49e84b68e6","html_url":"https://github.com/mcnaveen/license-gen","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mcnaveen/license-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Flicense-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Flicense-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Flicense-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Flicense-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcnaveen","download_url":"https://codeload.github.com/mcnaveen/license-gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Flicense-gen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265915097,"owners_count":23848490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es6-modules","hacktoberfest","license","license-generator","license-key","license-keys","nodejs","nodejs-library","nodejs-modules"],"created_at":"2024-11-07T22:16:56.115Z","updated_at":"2025-07-19T10:02:05.364Z","avatar_url":"https://github.com/mcnaveen.png","language":"JavaScript","funding_links":["https://patreon.com/mcnaveen","https://www.buymeacoffee.com/mcnaveen"],"categories":[],"sub_categories":[],"readme":"# Node License Key Generator\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n:unicorn: Simple utility to generate a license key in Node.js projects.\n\n![License Generator Module](https://github.com/mcnaveen/license-gen-example/workflows/Build/badge.svg)\n\n### :package: Requirements\n- Node.js 12X LTS or 14X LTS 📦\n\n### :sparkles: Installation\n\n- Install the NPM Package with the below command:\n```\nnpm install @mcnaveen/license-gen --save\n``` \n\n (or)\n\n- Install with Yarn:\n```\nyarn add @mcnaveen/license-gen\n```\n\n### :pen: Usage\n\n- Import the module in your project:\n\n```javascript\nimport generateLicenseKey from \"@mcnaveen/license-gen\";\n```\n\n### :bulb: Example\n\n- Import the module in your project\n- Pass the length of the license key you want to generate\n- Here I want to generate a license key with 32 characters\n\n```javascript\nimport generateLicenseKey from \"@mcnaveen/license-gen\";\n\nconst myKey = generateLicenseKey(32);\nconsole.log(myKey);\n```\n\n### :ballot_box_with_check: Example Output\n```\n8J5S-XN5P-73P2-XCPO-R37V-MPTH-TD6F-X270\n```\n---\n\n### :bulb: Example with Pair Length\nOptionally, You can pass the pair length of the license key as a second argument.\n\n- Here I want to generate a license key with 10 characters and pair length of 5\n\n```javascript\nimport { generateLicenseKey } from '@mcnaveen/license-gen';\n\nconst myKey = generateLicenseKey(10, 5);\nconsole.log(myKey);\n```\n\n### :ballot_box_with_check: Output with Specified Pair Length\n```\nOKXYT-PE8V5\n```\n\n\u003e If the Pair length is not specified, the default pair length will be set to 4.\n\n### :star2: Example Repo\nhttps://github.com/mcnaveen/license-gen-example\n\n### :book: License\n- MIT\n\n----\n\n#### Links:\n- dev.to (https://dev.to/mcnaveen/generating-license-key-in-nodejs-2ie8)\n- hashnode (https://mcnaveen.hashnode.dev/how-to-generate-license-key-with-nodejs)\n\n---\n\n#### :green_heart: Message\n\n\u003e No Additional dependencies used.\n\nI hope you find this useful. If you have any questions, please create an issue.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://hexmarkrecords.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/63052259?v=4?s=100\" width=\"100px;\" alt=\"Hexmark Records Ltd\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHexmark Records Ltd\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/mcnaveen/license-gen/commits?author=hexmarkrecords\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://mcnaveen.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8493007?v=4?s=100\" width=\"100px;\" alt=\"MC Naveen\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMC Naveen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/mcnaveen/license-gen/commits?author=mcnaveen\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcnaveen%2Flicense-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcnaveen%2Flicense-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcnaveen%2Flicense-gen/lists"}