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

libmon

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libmon

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Libmon Logo


title: "Preparing to Publish" date: 2021-02-20T14:20:19-06:00 draft: false

The Libmon Library handles token validation and usage limits for a library. It validates tokens against the Libmon service.

This package is open-source.

Unfortunately, the library does not work without make a call to the internet.

Set-Up

npm install libmon --save
const { Libmon } = require("libmon")
Libmon.intialize("my-calculator-package")

Libmon exposes a few methods such as crash() and increment() to create internal counters that limit the amount of usage on a library without updgrading to a token.

If a token is valid, Libmon methods will not crash a program.

Usage

The libmon library should not be exposed to the end user. It's used internally by your library, and users should pass in a token.


class MyCalculatorLibrary(){
    constructor(token){
        Libmon.intialize("my-calculator-package")

        // check if the token is valid. Makes internet call
        Libmon.validate(token);

        // create counter with a max of 10 calls
        Libmon.setupCounter("number-of-prime-calls", 10)
    }

    function myPaidMethod() {
        // artificially crash the program if token is invalid
        Libmon.disable();
        return "hello world"
    }

    function getPrimeNumber() {
        // increment the counter
        // throw an error if called > 10 times
        Libmon.increment("number-of-prime-calls")
        return 3
    }


}

Tolerance

Our intention is to make programs a little more inconvenient without a valid token rather than create strict payment models.

The consumer of a library and purchaser of a token always has benefit of the doubt.

  • If there is no internet, validation will always pass.
  • If the libmon server is down, validation will always pass

Generating Tokens

You can use our token generation service. To publish to Libmon, and get free tokens, simply purchase here. It costs $20 for 100 tokens.

We can help you setup a payment portal so you can charge for access to your library.

FAQs

Package last updated on 14 Mar 2021

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