{"analyzedAt":"2022-07-07T11:26:02.198Z","collected":{"metadata":{"name":"nodejs-license-file","scope":"unscoped","version":"4.0.0","description":"A lightweight License file generator and parser for NodeJS.","keywords":["license","file","generation","parsing","validation"],"date":"2018-03-03T20:37:31.201Z","author":{"name":"Yuriy Bushev","email":"bushevuv@gmail.com","username":"bushev"},"publisher":{"username":"bushev","email":"bushevuv@gmail.com"},"maintainers":[{"username":"bushev","email":"bushevuv@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/bushev/nodejs-license-file.git"},"links":{"npm":"https://www.npmjs.com/package/nodejs-license-file","homepage":"https://github.com/bushev/nodejs-license-file","repository":"https://github.com/bushev/nodejs-license-file","bugs":"https://github.com/bushev/nodejs-license-file/issues"},"license":"MIT","dependencies":{"json-stable-stringify":"1.0.1"},"devDependencies":{"mocha":"4.0.1","should":"13.1.3"},"releases":[{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2020-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1}],"hasTestScript":true,"readme":"## nodejs-license-file [![Build Status](https://travis-ci.org/bushev/nodejs-license-file.svg?branch=master)](https://travis-ci.org/bushev/nodejs-license-file)\n\nA lightweight License file generator and parser for NodeJS.\n\n## Generate a keypair using OpenSSL\n\n1. Generate an RSA 2048 bit private key\n\n    `openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048`\n\n2. Extract the public key from an RSA keypair\n\n    `openssl rsa -pubout -in private_key.pem -out public_key.pem`\n\n## Generating license file\n\n```javascript\nconst licenseFile = require('nodejs-license-file');\n\nconst template = [\n    '====BEGIN LICENSE====',\n    '{{&licenseVersion}}',\n    '{{&applicationVersion}}',\n    '{{&firstName}}',\n    '{{&lastName}}',\n    '{{&email}}',\n    '{{&expirationDate}}',\n    '{{&serial}}',\n    '=====END LICENSE====='\n].join('\\n');\n\ntry {\n \n    const licenseFileContent = licenseFile.generate({\n        privateKeyPath: 'path/to/key.pem',\n        template,\n        data: {\n            licenseVersion: '1',\n            applicationVersion: '1.0.0',\n            firstName: 'Name',\n            lastName: 'Last Name',\n            email: 'some@email.com',\n            expirationDate: '12/10/2025'\n        }\n    });\n    \n    console.log(licenseFileContent);\n\n} catch (err) {\n    \n    console.log(err);\n}\n```\n\nThis will produce a license key, which uses the default template and will look similar to this:\n```\n====BEGIN LICENSE====\n1\n1.0.0\nName\nLast Name\nsome@email.com\n12/10/2025\nxxxxxxxxxxxxxxxxxxxxx\n=====END LICENSE=====\n```\n\n## Parse and verify license file\n\n```javascript\nconst licenseFile = require('nodejs-license-file');\n\ntry {\n \n    const data = licenseFile.parse({\n        publicKeyPath: 'path/to/key.pub',\n        licenseFilePath: 'path/to/file.lic',\n        template\n    });\n    \n    console.log(data);\n    \n} catch (err) {\n    \n    console.log(err);\n}\n```\n\nThere is an execution result:\n```\n{\n    valid: true,\n    serial: 'oZDqoEr2avwhAqwV4HInq9otNzeBeD/azq2yn2jA ...',\n    data: {\n        licenseVersion: '1',\n        applicationVersion: '1.0.0',\n        firstName: 'Name',\n        lastName: 'Last Name',\n        email: 'some@email.com',\n        expirationDate: '12/10/2025'\n    }\n}\n```\n\nNOTICE: All numeric data will be converted to strings after parsing. You need to take care of a parsed data types."},"npm":{"downloads":[{"from":"2022-07-06T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":114},{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":552},{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":2316},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":7209},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":12105},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":24751}],"starsCount":1},"github":{"starsCount":71,"forksCount":17,"subscribersCount":4,"issues":{"count":11,"openCount":4,"distribution":{"3600":1,"10800":0,"32400":0,"97200":1,"291600":3,"874800":0,"2624400":3,"7873200":0,"23619600":0,"70858800":2,"212576400":1},"isDisabled":false},"contributors":[{"username":"r3nya","commitsCount":1},{"username":"bushev","commitsCount":23},{"username":"rjgreavesfp","commitsCount":1}],"commits":[{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0}],"statuses":[{"context":"continuous-integration/travis-ci/push","state":"success"}]},"source":{"files":{"readmeSize":2329,"testsSize":8463,"hasChangelog":true},"badges":[{"urls":{"original":"https://travis-ci.org/bushev/nodejs-license-file.svg?branch=master","service":"https://api.travis-ci.org/bushev/nodejs-license-file.svg?branch=master","shields":"https://img.shields.io/travis/bushev/nodejs-license-file/master.svg","content":"https://img.shields.io/travis/bushev/nodejs-license-file/master.json"},"info":{"service":"travis","type":"build","modifiers":{"branch":"master"}}}],"linters":["editorconfig"]}},"evaluation":{"quality":{"carefulness":0.9199999999999999,"tests":0.85,"health":1,"branding":0.15},"popularity":{"communityInterest":96,"downloadsCount":2403,"downloadsAcceleration":2.207020547945209,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6753370199706437,"detail":{"quality":0.9565349727127667,"popularity":0.10976638934751363,"maintenance":0.9998808339576686}}}