strongloop-license

1.5.2 • Public • Published

strongloop-license

Validates StrongLoop licenses.

Usage

The simplest case is to declare a simple license requirement that takes the default action if the license check fails.

Examples

String Form

require('strongloop-license')('some-product:some-feature=Special Sauce');

Options Form

require('strongloop-license')({
  product: 'some-product',
  feature: 'some-feature',
  label: 'Special Sauce',
});

Exit On Failure

require('strongloop-license')('core:feature', 'EXIT');

API

module(opts, [callback])

  • opts: an object or a string
    • string: a string of the format product[:feature][=label]
    • object: an object with the following properties:
      • product: product name
      • feature: feature name
      • label: friendly name for logs instead of product:feature
      • now: time to compare license against (defaults to Date.now()
      • interval: repeat license check ever interval ms (default to 0, disabled)
  • callback: function or String
    • function: function(err, name, result)
      • result is false or the license details of the matching license
    • string: name of builtin handler: 'NOOP', 'CONSOLE', 'EXIT'

module.CONSOLE

Default handler, prints a message to stderr if a license match is not found or a message to stdout stating when the license is valid.

/strongloop-license/

    Package Sidebar

    Install

    npm i strongloop-license

    Weekly Downloads

    177

    Version

    1.5.2

    License

    SEE LICENSE IN LICENSE.md

    Last publish

    Collaborators

    • dhmlau
    • ritch
    • 0candy
    • hacksparrow
    • rmg
    • bajtos
    • rfeng
    • superkhau
    • kraman
    • thegman
    • davidcheung
    • tonyf-ibm
    • qpresley
    • kjdelisle
    • amir-61
    • jannyhou2016
    • b-admike