npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dowelllabs/licensecompatibility

v2.0.0

Published

- The Opensource License Compatibility Check package establish how two licenses are compatible with each other. This is a percentage estimate of how likely it is to recommend use of two softwares under the two licenses in one project.

Downloads

2

Readme

DoWell Opensource-License-Compatibility

Version 2.0.0

Description

  • The Opensource License Compatibility Check package establish how two licenses are compatible with each other. This is a percentage estimate of how likely it is to recommend use of two softwares under the two licenses in one project.

  • To check how two license are compatible with each other, you are require to provide the first license name and the second license in the respective input fields and submit.

Installation

With npm:

    npm install @dowelllabs/licensecompatibility

With yarn:

    yarn add @dowelllabs/licensecompatibility

Usage

The license compatibility liberary require user apiKey, followed by first license name and second license name for compatibility check.

Example using function component

import { useState } from "react";
import { OpensourceLicenseCompatibility } from "@dowelllabs/licensecompatibility";

function App() {
  const [inputState, setInputState] = useState({
    first_license_name: "",
    second_license_name: "",
  });

  const [compatibilityResult, setCompatibilityResult] = useState("");

  const handleChangeState = (e) => {
    setInputState((prevState) => ({
      ...prevState,
      [e.target.name]: e.target.value,
    }));
  };

  const reset = () => {
    setCompatibilityResult("");
  };

  const checkLicenseCompatibility = async (e) => {
    e.preventDefault();

    const result = new OpensourceLicenseCompatibility()
      .compareLicenses({
        apiKey: process.env.REACT_APP_API_KEY,
        first_license_name: inputState.first_license_name,
        second_license_name: inputState.second_license_name,
      })
      .then((response) => {
        try {
          if (response) {
            const compatibilityStatus = response;
            setCompatibilityResult(compatibilityStatus);
          } else {
            setCompatibilityResult("Result not found");
          }
        } catch (error) {
          console.log(error);
        }
      });
  };

  return (
    <div className="App">
      <div className="card">
        <div className="card-body">
          {compatibilityResult !== "" ? (
            <div className="show-recommendation">
              <h2>{compatibilityResult}</h2>
              <button type="button" className="btn-submit" onClick={reset}>
                Ok
              </button>
            </div>
          ) : (
            <form onSubmit={checkLicenseCompatibility}>
              <div className="mb-3">
                <label htmlFor="firstLicense" className="form-label">
                  First License Name
                </label>
                <br />
                <input
                  type="text"
                  className="form-control"
                  id="firstLicense"
                  name="first_license_name"
                  value={inputState.first_license_name}
                  onChange={handleChangeState}
                />
              </div>
              <div className="mb-3">
                <label htmlFor="secondLicense">Second License Name</label>
                <br />
                <input
                  type="text"
                  className="form-control"
                  id="secondLicense"
                  name="second_license_name"
                  value={inputState.second_license_name}
                  onChange={handleChangeState}
                />
              </div>
              <div className="btn-wrapper">
                <button
                  type="submit"
                  className="btn-submit"
                >
                  Submit
                </button>
              </div>
            </form>
          )}
        </div>
      </div>
    </div>
  );
}

export default App;

API(conpareLicense)

compareLicenses({apiKey, first_license_name, second_license_name}) function used to initiates comparison between two licenses.

  1. -apiKey: Your API key for accessing the process module service.
  2. -first_license_name and second_license_name are use for comparison in order check how compatible both licenses are to each other. The comparion result usually returns Recommended, Highly Recommended or Not Recommended

License

This project is licensed under the Apache License 2.0.