# lsos

> :information_source: 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](https://lsos.org).

Latest version **0.2.1** (published 2021-01-05) · 0 weekly downloads

## Install

```sh
npm install lsos
pnpm add lsos
yarn add lsos
bun add lsos
```

Provides the command `lsos`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2021-01-05 |
| First published | 2020-06-19 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 184.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Maintainers | brillout |

## Links

- npm: https://www.npmjs.com/package/lsos
- Repository: https://github.com/Lsos/lsos-js
- Homepage: https://github.com/Lsos/lsos-js#readme
- Issues: https://github.com/Lsos/lsos-js/issues
- npm.io page: https://npm.io/package/lsos

## Recent versions

- 0.2.1 (latest) — 2021-01-05
- 0.1.2 — 2020-11-12
- 0.1.1 — 2020-11-12
- 0.1.0 — 2020-11-11
- 0.0.0-alpha.0 — 2020-06-19

## README

# Lsos Library for JavaScript

:information_source: 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](https://lsos.org).

See [Lsos - FAQ - What does the Lsos library do?](https://lsos.org/faq#lib) for an overview of what the Lsos libray does.

## Usage

```js
import { verify } from "lsos"; // npm install lsos

verify({
  // Your project's name
  projectName: "My Open Source Project", // Required

  // Your npm package that calls this `verify()` function
  npm: "my-open-source-project", // Required

  // Only require an activation key when your user's repository had
  // `minNumberOfAuthors` Git authors in the last 3 months.
  minNumberOfAuthors: 3, // Optional (default value: 3)

  // Never block users, show a `console.warn` instead.
  trustMode: false, // Optional (default value: false)

  // Free trial
  freeTrialDays: 31, // Optional (default value: 31)
});
```

If your user needs an activation key but doesn't have one then `verify()` throws an error blocking your user from using your code.

Your user doesn't need an activation key if:

- Your user's repository had less than `minNumberOfAuthors` Git authors in the last 3 months.
  (We consider a repository with only few authors a small project; Lsos projects are free for small projects.)
- Your user's repository is public. (This means that your project can be developed and contributed to without activation key.)
- The free trial didn't end. (A `console.info` is shown to your user letting him know that he is using the free trial.)
- The [`trustMode` option](https://lsos.org/faq#trust-mode) is set to `true`.

`verify()` (and the Lsos in general) has no effects in these situations.

All checks are done by calling Git commands in the postinstall step.
Other than Git commands, nothing external to the `lsos` code is executed and no network calls are made.
The `verify` function has no dependencies and is isomorphic;
the `lsos` package can be used for Node.js libraries as well as browser libraries.

<br/>

---
_Source: https://npm.io/package/lsos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
