open-index/open-npm huggingface dataset:
npm package: @libscie/design-library
Description: Liberate Science design library, according to the design standards.
Author: Liberate Science GmbH
Latest version: 1.0.1

# Design library <img src="https://raw.githubusercontent.com/libscie/design/main/libscie-logomark-1024-square.png" align="right" height="64" />

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

This repository helps standardize way designs are implemented across liberate science projects. This makes it easier to propagate any changes to the design system, by simply updating this library.

## Usage

```sh
npm install @libscie/design-library
```

```js
const libscie = require('@libscie/design-library')
// If you want to import only specific parts of the design library
const { colors } = require('@libscie/design-library')
```

## Colors

```js
const background = libscie.colors.purple900
const alternatively = colors.purple900
```

![Color library cheatsheet](./color-cheatsheet.png)

The name is the base color; the number is the saturation, with base `500`. The only exception is `white`, which has no saturation and replaces `mono100`.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="http://sobrakseaton.com"><img src="https://avatars.githubusercontent.com/u/28573875?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patrick Sobrak-Seaton</b></sub></a><br /><a href="#design-psobrakseaton" title="Design">🎨</a></td>
    <td align="center"><a href="https://chjh.nl"><img src="https://avatars.githubusercontent.com/u/2946344?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chris Hartgerink</b></sub></a><br /><a href="https://github.com/libscie/design-library/commits?author=chartgerink" title="Code">💻</a> <a href="#maintenance-chartgerink" title="Maintenance">🚧</a></td>
  </tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
npm package: @libscode/react-native-modern-datepicker
Description: A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale)
Author: Hossein Shabani
Latest version: 1.0.0-beta.92

# React Native Modern Datepicker 📆

A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale). For more information, please visit [website](https://hosseinshabani.github.io/react-native-modern-datepicker)

<a href="https://hosseinshabani.github.io/react-native-modern-datepicker">
	<img src="http://tehranreact.ir/public/react-native-modern-datepicker.jpg" alt="hero image" />
</a>
npm package: @libsem/identity
Description: Library for managing identites for Semaphore and Rln protocols.
Author: Andrija Novakovic
Latest version: 1.0.22

<p align="center">
    <h1 align="center">
        Semaphore identities
    </h1>
    <p align="center">Library for managing identites for Semaphore and Rln protocols.</p>
</p>

<p align="center">
    <a href="https://github.com/appliedzkp/libsemaphore/blob/master/LICENSE">
        <img alt="Github license" src="https://img.shields.io/github/license/appliedzkp/libsemaphore.svg?style=flat-square">
    </a>
    <a href="https://www.npmjs.com/package/@libsem/identity">
        <img alt="NPM version" src="https://img.shields.io/npm/v/@libsem/identity?style=flat-square" />
    </a>
    <a href="https://npmjs.org/package/@libsem/identity">
        <img alt="Downloads" src="https://img.shields.io/npm/dm/@libsem/identity.svg?style=flat-square" />
    </a>
    <a href="https://bundlephobia.com/package/@libsem/identity">
        <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@libsem/identity" />
    </a>
    <a href="https://eslint.org/">
        <img alt="Linter eslint" src="https://img.shields.io/badge/linter-eslint-8080f2?style=flat-square&logo=eslint" />
    </a>
    <a href="https://prettier.io/">
        <img alt="Code style prettier" src="https://img.shields.io/badge/code%20style-prettier-f8bc45?style=flat-square&logo=prettier" />
    </a>
</p>

---

## 🛠 Install

### npm or yarn

Install the `@libsem/identity` package with npm:

```bash
npm i @libsem/identity
```

or yarn:

```bash
yarn add @libsem/identity
```

## 📜 Usage

**Import**

```typescript
import { ZkIdentity, Identity } from "@libsem/identity"
```

```javascript
const { ZkIdentity } = require("@libsem/identity")
```

**Mainpulation**

```typescript
const identity: ZkIdentity = new ZkIdentity();
const identityCommitment: bigint = identity.genIdentityCommitment();
```

**Serialization**

```typescript
const identity: ZkIdentity = new ZkIdentity();
const serialized: string = identity.serializeIdentity()
const unserialized: ZkIdentity = ZkIdentity.genFromSerialized(serialized);
```
npm package: @libsem/protocols
Description: Client library for generating and verifying Semaphore & Rln ZK proofs.
Author: Andrija Novakovic
Latest version: 1.0.27

<p align="center">
    <h1 align="center">
        Semaphore protocols
    </h1>
    <p align="center">Client library for generating and verifying Semaphore & Rln ZK proofs.</p>
</p>

<p align="center">
    <a href="https://github.com/appliedzkp/libsemaphore/blob/master/LICENSE">
        <img alt="Github license" src="https://img.shields.io/github/license/appliedzkp/libsemaphore.svg?style=flat-square">
    </a>
    <a href="https://www.npmjs.com/package/@libsem/protocols">
        <img alt="NPM version" src="https://img.shields.io/npm/v/@libsem/protocols?style=flat-square" />
    </a>
    <a href="https://npmjs.org/package/@libsem/protocols">
        <img alt="Downloads" src="https://img.shields.io/npm/dm/@libsem/protocols.svg?style=flat-square" />
    </a>
    <a href="https://bundlephobia.com/package/@libsem/protocols">
        <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@libsem/protocols" />
    </a>
    <a href="https://eslint.org/">
        <img alt="Linter eslint" src="https://img.shields.io/badge/linter-eslint-8080f2?style=flat-square&logo=eslint" />
    </a>
    <a href="https://prettier.io/">
        <img alt="Code style prettier" src="https://img.shields.io/badge/code%20style-prettier-f8bc45?style=flat-square&logo=prettier" />
    </a>
</p>

---

## 🛠 Install

### npm or yarn

Install the `@libsem/protocols` package with npm:

```bash
npm i @libsem/protocols
```

or yarn:

```bash
yarn add @libsem/protocols
```

## 📜 Usage

**Import**

```typescript
import { ZkIdentity, Identity } from "@libsem/identity"
import {
  Semaphore,
  MerkleProof,
  IProof,
  generateMerkleProof,
  genExternalNullifier,
  genSignalHash
} from "@libsem/protocols"
```

```javascript
const { ZkIdentity } = require("@libsem/identity")
const { Semaphore, Rln, NRln, generateMerkleProof, genExternalNullifier, genSignalHash } = require("@libsem/protocols")
```

**Merkle Proofs**
Generate merkle proof for your identity given the array of registered identity commitments

```typescript
const identityCommitments: Array<bigint> = [...];
const identity: ZkIdentity = new ZkIdentity();
const identityCommitment: bigint = identity.genIdentityCommitment();

const merkleProof: MerkleProof = generateMerkleProof(TREE_DEPTH, ZERO_VALUE, NUMBER_OF_LEAVES_PER_NODE, identityCommitments, identityCommitment);
```

**Semaphore**

In order to create semaphore proof, make sure to

```typescript
const witness = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal)
const fullProof = await Semaphore.genProof(witness, wasmFilePath, finalZkeyPath)
```

## 📜 Final Note

For full examples of how to integrate with contracts check https://github.com/appliedzkp/semaphore repository.

For additional info check tests directory.
npm package: @libshaun/mc-fontpicker
Description: A simple google font picker component for Vue.js. Easy to implement, easy to use.
Author: Shaun Simmons
Latest version: 1.0.1

# vue-fontpicker

A simple google font picker component for Vue.js. Easy to implement, easy to use.

This is a fork of https://github.com/Mikk3lRo/vue-fontpicker with an updated set
of fonts.

# Documentation
Documentation and live demo is available at:
https://mikk3lro.github.io/vue-fontpicker/

# Installing

```bash
# yarn  
yarn add @libshaun/mc-fontpicker
# npm
npm i @libshaun/mc-fontpicker
```

Then, import and register the component and stylesheet:

```js
import McFontpicker from '@libshaun/mc-fontpicker';
import '@libshaun/mc-fontpicker/dist/mc-fontpicker.css';

Vue.component("McFontpicker", McFontpicker);
```
npm package: @libshaun/mdi-vue
Description: Generates Vue components for the icons provided by Google's Material Icons library
Author: Shaun Simmons
Latest version: 5.0.8

# Material Design Icons

[![npm](https://img.shields.io/npm/v/@libshaun/mdi-vue)](https://www.npmjs.com/package/@libshaun/mdi-vue)

This library generates Vue 3 components for Google's Material Design icons library.
https://github.com/google/material-design-icons

## Usage

1. Install the package.

   ```console
   npm i @libshaun/mdi-vue
   ```

2. Import an icon component.

   * Option 1:

   ```javascript
   import Map from '@libshaun/mdi-vue/Map';
   ```

   * Option 2:

   ```javascript
   import { Map } from '@libshaun/mdi-vue';
   ```

   > Option 1 is safer to use, but Option 2 is a bit cleaner. Make sure you utilize
     tree shaking if using the second approach or you will end up with a multi-MB bundle.

3. Then use it somewhere. e.g.

   ```html
   <template>
    <button>
      <Map />
      Map
    </button>
   </template>

   <script>
   import { Map } from '@libshaun/mdi-vue';
   import { defineComponent } from 'vue'

   export default defineComponent({
     components: {
       Map,
     },
   })
   </script>
   ```

## How to generate icons

1. Fork and/or clone this repo.

2. Install dependencies.

   ```console
   npm install
   ```

3. Run the generator script.

   ```console
   npm run generate
   ```

## Maintenance

Simply push a new tag and the GitHub Action will generate the components and release on NPM.
npm package: @libshin/in-viewport
Description: Check if DOM element is in viewport
Author: Ayc0
Latest version: 0.2.2

# TL;DR

Check if a DOM element is in viewport or not.

## How to use

```js
const inViewport = require("@libshin/in-viewport");

const element = document.getElementById("id");

// inViewport(element: DOMELement, strict: boolean = true)
inViewport(element, true);
// true
```

This function has two modes:

- strict mode
- loose mode

### Strict mode

In strict mode, the function `inViewport` returns `true` is the element is completely within the viewport. If a little part is off the viewport, it will return `false`.

### Loose mode

In loose mode, the function `inViewport` returns `true` is at least a part of the element is within the viewport and returns `false` is the element is completely off the viewport.

## Listener

```js
const viewportListener = require("@libshin/in-viewport.listener");

const element = document.getElementById("id");

function onVisibilityChange(visible) {
  // content
}

// viewportListener.attach(element: DOMElement, strict: boolean, options, callback: visible => any) => id: number
const id = viewportListener.attach(element, true, onVisibilityChange, {});

// viewportListener.detach(id: number)
viewportListener.detach(id);
```

`onVisibilityChange` will only be called when the visibility changes.

The strict / loose mode is the same as previously.

## Options

```js
const defaultOptions = {
  top: 0,
  bottom: 0,
  left: 0,
  right: 0,
  now: false
};
```

`top`, `bottom`, `left`, `right` are extension values of the viewport (`bottom: 50` extends the viewport of 50px at the bottom)

`now` triggers the scan function immediately, and doesn't wait for a scroll, resize, load event.
npm package: @libshin/interval
Description: Create flexible intervals
Author: ayc0
Latest version: 1.0.4

# TL;DR

Create flexible intervals

## How to use

```js
import interval from "@libshin/interval";

// interval(fn: () => ?number, initialTTL: number, options)
const timer = interval(fn, 500);

// The timer is defined

timer.start(); // Start it (1st call of fn in 500ms)
timer.startNow(); // Start timer and immediately calls fn
timer.stop(); // When the timer is running
timer.restart(); // Stops timer and calls start()
timer.restartNow(); // Stops timer and calls startNow()
```

## Why flexible?

The main difference with regular `setTimeout` in JS is that if the callback function `fn` returns a number, it will be the new time interval before the next call of `fn`.

```js
import interval from "@libshin/interval";

const fn = () => {
  console.log('fn is called')
  return 1500;
}

const timer = interval(fn, 500);

timer.start()

> "fn is called" // after 500ms
> "fn is called" // after 1500ms
> "fn is called" // after 1500ms
> "fn is called" // after 1500ms
...
```

Furthermore, `start` and `restart` can take a initial ttl:

```js
import interval from "@libshin/interval";

const fn = () => {
  console.log('fn is called')
}

const timer = interval(fn, 500);

timer.start(1500)

> "fn is called" // after 1500ms
> "fn is called" // after 500ms
> "fn is called" // after 500ms
> "fn is called" // after 500ms
...
```

## Options

| Field          | Value           | Default         | Description                                                                                      |
| -------------- | --------------- | --------------- | ------------------------------------------------------------------------------------------------ |
| `ignoreErrors` | `boolean`       | `true`          | If set to `true`, when the function `fn` fails, the timer will continue, otherwise, it will stop |
| `errorCb`      | `error => void` | `console.error` | Function that is called when function `fn` fails if `ignoreErrors` is set to `true`              |
npm package: @libshin/koa-logger
Description: Morgan like logger for koa
Author: Ayc0
Latest version: 1.0.0

# TL;DR

Logger for koa

## Installation

### npm

```
$ npm i --save @libshin/koa-logger
```

### yarn

```
$ yarn add @libshin/koa-logger
```

## How to use

```js
const Koa = require("koa");
const logger = require("@libshin/koa-logger");

const app = new Koa();

if (process.env.NODE_ENV !== "production") {
  app.use(logger);
}

app.use(async ctx => {
  ctx.body = "Hello World";
});

const DEFAULT_PORT = 3000;
const PORT = process.env.PORT || DEFAULT_PORT;

app.listen(PORT);
```
npm package: @libshin/lazy-image
Description: Lazy load images that are off the viewport
Author: ayc0
Latest version: 0.3.1

# TL;DR

Lazy load images that are off the viewport.

Take a look at an [example](https://libshin.github.io/lazy-image/index.html).

## How to use

### Basic usage

In order to use this package, just use `lazy-url` instead of `url` in `<img>`.

```html
<!-- head -->
<link rel="stylesheet" href="..../lazy-image.css">
<!-- somewhere in the body -->
<img lazy-src="image_url" alt="alt">
<!-- footer -->
<script src="..../lazy-image.umd.js"></script>
<script>
  lazyImage() // Scan for img[lazy-src]
</script>
```

### Placeholder

If you wrap a `img[lazy-src]` inside of a `[lazy-placeholder]`, the image related to `lazy-placeholder` will be shown instead of the image and once the image is loaded, `lazy-src` will appear and replace `lazy-placeholder`.

```html
<!-- head -->
<link rel="stylesheet" href="https://unpkg.com/@libshin/lazy-image/build/lazy-image.css">
<!-- somewhere in the body -->
<div lazy-placeholder="placeholder_src">
  <img lazy-src="image_url" alt="alt">
</div>
<!-- footer -->
<script src="https://unpkg.com/@libshin/lazy-image/build/lazy-image.umd.js"></script>
<script>
  lazyImage(strict, options) // Scan for img[lazy-src] and [lazy-placeholder]
</script>
```

See [here](https://github.com/libshin/inViewport#strict-mode) for the details on the strict/loose mode and [here](https://github.com/libshin/inViewport#options) for the options' details.

## Web Component

```html
<!-- Polyfills -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>


<link rel="import" href="https://unpkg.com/@libshin/lazy-image/webcomponent/lazy-image.html">

<lazy-img src="image_url"></lazy-img>

<lazy-img placeholder="placeholder_src" src="image_url"></lazy-img>
```
npm package: @libshin/random-array
Description: Shuffle and shorten an array.
Author: ayc0
Latest version: 1.1.2

# TL;DR

Shuffle and shorten an array.

```js
// randomArray(originArray)
randomArray([1, 2, 3, 4, 5, 6]);
// [4, 5, 3, 2, 1]

// randomArray(originArray, maxLength)
randomArray([1, 2, 3, 4, 5, 6], 2);
// [5, 3]

// randomArray(originArray, [minLength, maxLength])
randomArray([1, 2, 3, 4, 5, 6], [3, 5]);
// [4, 6, 2, 3]
```

## Install

### Browser

```html
<script src="https://unpkg.com/@libshin/random-array(@version)/build/random-array.umd.js"></script>
```

You don't have to specify the version of the module. By default it will redirect to the latest version.

### NPM

```bash
npm i --save @libshin/random-array
```

### Yarn

```bash
yarn add @libshin/random-array
```

## Import

### Browser

```js
const randomArray = window["@libshin/random-array"];
```

### Node

```js
const randomArray = require("@libshin/random-array");
```

### ES Module

```js
import randomArray from "@libshin/random-array";
```
npm package: @libshin/retry-until
Description: Retry promises n times
Author: ayc0
Latest version: 1.0.1

# TL;DR

Retry promises at most n times

## How to use

```js
import retryUntil from '@libshin/retry-until';

// retryUntil(fn: () => Promise, maxIterate = 10, timeout = 1000) => Promise
retryUntil(fn, 5, 500).then(...)
```

With run the function fn and if it fails, rerun it at most 5 times with 500ms interval between two calls.

## Examples

### With classic function

```js
import retryUntil from '@libshin/retry-until';

let i = 0
const fn = () => {
  if (i++ !== 2) {
    console.log(i, false)
    throw new Error(false)
  }
    console.log(i, true)
    return true
}

retryUntil(fn, 10, 1000).then(() => console.log('done'))

> 1 false
> 2 false
> 3 true
> done
```

### With Promises

```js
import retryUntil from '@libshin/retry-until';

let i = 0
const fn = () => new Promise((res, rej) => {
  if (i++ !== 2) {
    console.warn(i, false)
    rej(false)
  } else {
    console.log(i, true)
    res(true)
  }
})

retryUntil(fn, 10, 1000).then(() => console.log('done'))

> 1 false
> 2 false
> 3 true
> done
```
npm package: @libsql/hrana-client
Description: Hrana client for connecting to sqld over HTTP or WebSocket
Latest version: 0.9.0

# Hrana client for TypeScript

**[API docs][docs] | [Github][github] | [npm][npm]**

[docs]: https://libsql.org/hrana-client-ts/
[github]: https://github.com/libsql/hrana-client-ts/
[npm]: https://www.npmjs.com/package/@libsql/hrana-client

This package implements a Hrana client for TypeScript. Hrana is the protocol for connecting to sqld using WebSocket or HTTP.

> This package is intended mostly for internal use. Consider using the [`@libsql/client`][libsql-client] package, which will use Hrana automatically.

[libsql-client]: https://www.npmjs.com/package/@libsql/client

## Usage

```typescript
import * as hrana from "@libsql/hrana-client";

// Open a `hrana.Client`, which works like a connection pool in standard SQL
// databases. 
const url = process.env.URL ?? "ws://localhost:8080"; // Address of the sqld server
const jwt = process.env.JWT; // JWT token for authentication
// Here we are using Hrana over WebSocket:
const client = hrana.openWs(url, jwt);
// But we can also use Hrana over HTTP:
// const client = hrana.openHttp(url, jwt);

// Open a `hrana.Stream`, which is an interactive SQL stream. This corresponds
// to a "connection" from other SQL databases
const stream = client.openStream();

// Fetch all rows returned by a SQL statement
const books = await stream.query("SELECT title, year FROM book WHERE author = 'Jane Austen'");
// The rows are returned in an Array...
for (const book of books.rows) {
    // every returned row works as an array (`book[1]`) and as an object (`book.year`)
    console.log(`${book.title} from ${book.year}`);
}

// Fetch a single row
const book = await stream.queryRow("SELECT title, MIN(year) FROM book");
if (book.row !== undefined) {
    console.log(`The oldest book is ${book.row.title} from year ${book.row[1]}`);
}

// Fetch a single value, using a bound parameter
const year = await stream.queryValue(["SELECT MAX(year) FROM book WHERE author = ?", ["Jane Austen"]]);
if (year.value !== undefined) {
    console.log(`Last book from Jane Austen was published in ${year.value}`);
}

// Execute a statement that does not return any rows
const res = await stream.run(["DELETE FROM book WHERE author = ?", ["J. K. Rowling"]])
console.log(`${res.affectedRowCount} books have been cancelled`);

// When you are done, remember to close the client
client.close();
```
npm package: @libsql/isomorphic-fetch
Description: Isomorphic fetch() in Node, Deno and Cloudflare Workers
Latest version: 0.3.1

# `@libsql/isomorphic-fetch`

This package provides `fetch()` on Node (using `node-fetch`) and in Deno and Cloudflare Workers (using the native `fetch()`). Supports both CommonJS and ES modules.

```javascript
import { fetch } from "@libsql/isomorphic-fetch";

fetch("http://localhost:8080").then((response) => {
    response.text().then((text) => {
        console.log(text);
    });
});
```
npm package: @libsql/isomorphic-ws
Description: Isomorphic WebSockets in Node, Bun, Deno and Cloudflare Workers
Latest version: 0.1.5

# `@libsql/isomorphic-ws`

This package provides `WebSocket` on Node (using `ws`) and in Deno and Cloudflare Workers (using the native `WebSocket`). Supports both CommonJS and ES modules.

```javascript
import { WebSocket } from "@libsql/isomorphic-ws";

const ws = new WebSocket("ws://localhost:8080");
ws.onopen = (event) => {
    ws.send("Hello");
};
ws.onmessage = (event) => {
    console.log(event.data);
    ws.close();
};
```
npm package: @libsql/knex-libsql
Description: Knex dialect for libSQL
Latest version: 0.1.0

# knex-libsql

A [Knex][knex] dialect for [libSQL/sqld][sqld], using the [`@libsql/sqlite3`][libsql-node-sqlite3] package
that emulates `sqlite3`.

[knex]: https://github.com/knex/knex
[sqld]: https://github.com/libsql/sqld
[libsql-node-sqlite3]: https://github.com/libsql/libsql-node-sqlite3

## Installation

```shell
npm install @libsql/knex-libsql
```

## Usage

```javascript
const Client_Libsql = require('@libsql/knex-libsql');
const Knex = require("knex");

const knex = Knex({
    client: Client_Libsql,
    connection: {
        filename: "libsql://localhost:8080?tls=0",
    },
});
```

### URL

The library accepts the same URLs as [`@libsql/sqlite3`][libsql-node-sqlite3-url]:

- `http://` and `https://` connect to a libsql server over HTTP,
- `ws://` and `wss://` connect to the server over WebSockets,
- `libsql://` connects to the server using the default protocol (which is now HTTP). `libsql://` URLs use TLS by default, but you can use `?tls=0` to disable TLS (e.g. when you run your own instance of the server locally).

To use a JWT for authentication, you can use the `authToken` query parameter (for example,
`ws://localhost?authToken=<token>`).

You can also pass a `file:` URL to use a local file, like `file:test.db` or `file:/tmp/test.db`.

## License

This project is licensed under the MIT license.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `@libsql/knex-libsql` by you, shall be licensed as MIT, without any additional terms or conditions.
npm package: @libsql/kysely-libsql
Description: Kysely dialect for libSQL
Latest version: 0.4.1

# kysely-libsql

A [Kysely][kysely] dialect for [libSQL/sqld][sqld], using the [Hrana][hrana-client-ts] protocol over a WebSocket.

[kysely]: https://github.com/koskimas/kysely
[sqld]: https://github.com/libsql/sqld
[hrana-client-ts]: https://github.com/libsql/hrana-client-ts

## Installation

```shell
npm install @libsql/kysely-libsql
```

## Usage

Pass a `LibsqlDialect` instance as the `dialect` when creating the `Kysely` object:

```typescript
import { Kysely } from "kysely";
import { LibsqlDialect } from "@libsql/kysely-libsql";

interface Database {
    ...
}

const db = new Kysely<Database>({
    dialect: new LibsqlDialect({
        url: "libsql://localhost:8080?tls=0",
        authToken: "<token>", // optional
    }),
});
```

Instead of a `url`, you can also pass an instance of `Client` from [`@libsql/hrana-client`][hrana-client-ts] as `client`:

```typescript
import * as hrana from "@libsql/hrana-client";
// Alternatively, the `kysely-libsql` package reexports the `hrana-client`
//import { hrana } from "@libsql/kysely-libsql";

const client = hrana.open("ws://localhost:2023");

const db = new Kysely<Database>({
    dialect: new LibsqlDialect({ client }),
});

// after you are done with the `db`, you must close the `client`:
client.close();
```

## Supported URLs

The library accepts the [same URL schemas][supported-urls] as [`@libsql/client`][libsql-client-ts] except `file:`:

- `http://` and `https://` connect to a libsql server over HTTP,
- `ws://` and `wss://` connect to the server over WebSockets,
- `libsql://` connects to the server using the default protocol (which is now HTTP). `libsql://` URLs use TLS by default, but you can use `?tls=0` to disable TLS (e.g. when you run your own instance of the server locally).

Connecting to a local SQLite file using `file:` URL is not supported; we suggest that you use the native Kysely dialect for SQLite.

[libsql-client-ts]: https://github.com/libsql/libsql-client-ts
[supported-urls]: https://github.com/libsql/libsql-client-ts#supported-urls

## License

This project is licensed under the MIT license.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `@libsql/kysely-libsql` by you, shall be licensed as MIT, without any additional terms or conditions.