Package Exports
- lsos
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lsos) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Lsos Library for JavaScript
ℹ️ This readme is meant for developers of open source projects who want to integrate the Lsos. Users of Lsos projects can get more infos at lsos.org.
See Lsos - FAQ - What does the Lsos library do? for an overview of what the Lsos libray does.
Usage
import { verify } from "lsos"; // npm install lsos
// The `lsos` package works in the browser as well as in Node.js.
verify({
// Your npm package name
npm: "my-open-source-project",
// Your project name
projectName: "My Open Source Project",
// Only require an activation key when the user's repository had
// `minNumberOfAuthors` Git authors in the last 3 months.
minNumberOfAuthors: 3, // Default value
// Show a `console.warn` instead of blocking the user.
onlyWarning: false, // Default value
// Free trial
freeTrialDays: 7 // Default value
});The verify() function throws an error if your user doesn't have an activation key,
with following exception:
- The user's repository had less than
minNumberOfAuthorsGit authors in the last 3 months. (If the repo has few authors we consider it to be a "small" project; the user can use your code without activation key and theverify()has no effects whatsoever.) - The user's repository is public. (Allowing your project to be developed and contributed to without activation key.)
- The free trial didn't end. (A
console.infois shown to the user letting him know that he is using the free trial.) - The
onlyWarningoption is set totrue. (Aconsole.warnis shown instead of throwing an error. This means that users can indefinitely use your code without activation key. Such trust-based practice has shown many successes in the past, for example Sublime Text.)
Make sure that when verify() throws an error that it actually blocks the usage of your code.