@camunda/license-validator
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

License Validator

Usage

Validate License

try {
    const licenseChecker = new LicenseChecker(licenseUtf8String);
    licenseChecker.validate(); // Prints License to sysout + if the license is valid or not

    return {
        isValid: true
    };
} catch (error) { // throws if license is invalid/expired/not a c8 license
    return {
        isValid: false
    };
}

Get Properties

const licenseChecker = new LicenseChecker(licenseUtf8String);
licenseChecker.validate();
licenseChecker.getValue('customer') // returns the property with the key `customer`

Get All Properties

const licenseChecker = new LicenseChecker(licenseUtf8String);
licenseChecker.validate();
const map:Map<string, string> = licenseChecker.getAllKeyValues();

Validate test Licenses

const licenseChecker = new LicenseChecker(licenseUtf8String, true);
licenseChecker.validate();

Use a custom logger

const licenseChecker = new LicenseChecker(licenseUtf8String,
    false,
    (info: string) => {myInfoLogger(text)},
    (err: string) => {myErrorLogger(text)});
licenseChecker.validate();

Readme

Keywords

none

Package Sidebar

Install

npm i @camunda/license-validator

Weekly Downloads

857

Version

0.1.5

License

Apache-2.0

Unpacked Size

31 kB

Total Files

9

Last publish

Collaborators

  • nikku
  • barmac
  • maxtru
  • philippfromme
  • marstamm
  • camunda_it
  • omranabazid
  • husnauygur
  • skaiir-camunda
  • vsgoulart
  • urbanisierung
  • jroquescamunda
  • ev-camunda