open-index/open-npm huggingface dataset:
npm package: @kuiperdb/client
Description: TypeScript/JavaScript client for KuiperDb - a vector database with document relations
Latest version: 0.1.4

# KuiperDb TypeScript Client

A TypeScript/JavaScript client library for KuiperDb - a vector database with document relations and graph capabilities.

## Installation

```bash
npm install @kuiperdb/client
# or
yarn add @kuiperdb/client
```

## Quick Start

```typescript
import { createClient } from '@kuiperdb/client';

const client = createClient({
  baseURL: 'http://localhost:8080',
});

// Store a document
const doc = await client.storeDocument('my_db', 'articles', {
  content: 'This is my article...',
  metadata: { author: 'John' },
  tags: ['typescript'],
});

// Search
const results = await client.search('my_db', 'articles', {
  query: 'typescript article',
  limit: 10,
});

// Create relations
await client.createRelation('my_db', {
  source_id: doc1.id,
  target_id: doc2.id,
  relation_type: 'REFERENCES',
});

// Traverse graph
const graph = await client.graphTraverse('my_db', {
  start_id: doc.id,
  max_depth: 2,
});
```

See full documentation at [https://github.com/kuipersys/kuiperdb](https://github.com/kuipersys/kuiperdb)
npm package: @kuiperdb/react
Description: React components and hooks for KuiperDb - a vector database with document relations
Latest version: 0.1.4

# @kuiperdb/react

React components and hooks for KuiperDb - a vector database with document relations.

## Installation

```bash
npm install @kuiperdb/react @kuiperdb/client
```

## Usage

### Provider Setup

Wrap your app with the `KuiperDbProvider`:

```tsx
import { KuiperDbProvider } from '@kuiperdb/react';

function App() {
  return (
    <KuiperDbProvider baseURL="http://localhost:8080">
      <YourComponents />
    </KuiperDbProvider>
  );
}
```

### Using the Client Hook

Access the KuiperDb client in any component:

```tsx
import { useKuiperDb } from '@kuiperdb/react';

function DatabaseList() {
  const { client } = useKuiperDb();
  
  useEffect(() => {
    const fetchDatabases = async () => {
      const databases = await client.getDatabases();
      console.log(databases);
    };
    fetchDatabases();
  }, [client]);
  
  return <div>...</div>;
}
```

### With React Query

```tsx
import { useQuery } from '@tanstack/react-query';
import { useKuiperDb } from '@kuiperdb/react';

function DatabaseList() {
  const { client } = useKuiperDb();
  
  const { data: databases, isLoading } = useQuery({
    queryKey: ['databases'],
    queryFn: () => client.getDatabases(),
  });
  
  if (isLoading) return <div>Loading...</div>;
  
  return (
    <div>
      {databases?.map(db => (
        <div key={db.name}>{db.name}</div>
      ))}
    </div>
  );
}
```

## API

### `KuiperDbProvider`

**Props:**
- `children: ReactNode` - Child components
- `baseURL?: string` - KuiperDb server URL (default: '/')
- `timeout?: number` - Request timeout in milliseconds (default: 30000)

### `useKuiperDb()`

Returns an object with:
- `client: KuiperDbClient` - The KuiperDb client instance

See [@kuiperdb/client](../kuiperdb-ts/README.md) for full client API documentation.

## License

MIT
npm package: @kuiperswap/sdk
Description: 🛠 An SDK for building applications on top of Kuiperswap.
Latest version: 0.0.9

# Pancakeswap SDK

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/bchdev44/kuiper-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd kuiperswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @kuiu/indexed-db
Description: js indexeddb
Author: tobog
Latest version: 1.0.0

# indexedDB
## 支持功能
1. 动态创建数据表
2. 最大存储数据量
3. 支持数据过期
4. 支持添加，批量添加，按条件查询，删除，批量删除， 更新，批量更新
5. 支持导出数据

## demo
```js
import indexedDB from '@kui/indexedDB';
const instance = new indexedDB('dbName', {
    maxAge: 10, // 默认保存10天，
    maxLength: 1000, // 默认每个数据表保存1000 条数据
    tables: {
        // 表结构
        tableName: {
            keyPath: "$id", // 默认主键
            autoIncrement: true, // 自增
            indexNames: {
                // 索引
                indexName: true
            }
        }
    }
})
instance.add('tableName', data, {
    multi: false,
    ...tableConfig
}) => Promise

instance.query('tableName', {
    value: any,
    indexName: string | null,
    count: number;
    keyRange: IDBKeyRange,
    direction: IDBCursorDirection
}) => Promise
instance.delete('tableName', {
    value: any,
    indexName: string | null,
    count: number;
    keyRange: IDBKeyRange,
    direction: IDBCursorDirection
}) => Promise
instance.update('tableName', {
    value: any,
    indexName: string | null,
    count: number;
    keyRange: IDBKeyRange,
    direction: IDBCursorDirection
}) => Promise
// 导出
instance.export('tableName')

```



### todo
1. 内置config 表数据
npm package: @kuiu/mock-proxy
Description: mock proxy
Author: tobog
Latest version: 1.0.0

## 简介
能将接口数据缓存到本地， 在没有网络的情况下， 可以正常使用

## 安装
```bash
npm install @kuiu/mock-proxy
```

## vue-cli和webpack 中使用
```js
const { defineConfig } = require('@vue/cli-service')
const path = require('path');
 const { writeData, readData, setDir } = require('@kuiu/mock-proxy');
setDir(path.join(__dirname, './mocks-cache/'));

module.exports = defineConfig({
    devServer: {
        proxy: {
            '/getConfig': {
                target: '',
                onProxyReq: readData,
                onProxyRes: writeData
            },
            
        },
    },
})

```

## 在vite中使用
```js
    import { defineConfig } from 'vite'
    import path from 'path'
    const { writeData, readData, setDir } = require('@kuiu/mock-proxy');
    setDir(path.join(__dirname, './mocks-cache/')); 
    // https://vite.dev/config/
    export default defineConfig({
        plugins: [],
        server: {
            proxy: {
                '/api': {
                    target: '',
                    configure(proxy, options) {
                        proxy.on('proxyReq', readData)
                        proxy.on('proxyRes', writeData)
                    }
                },
            },
        },      
    })

    
```
npm package: @kuiu/task-worker
Description: task worker
Author: tobog
Latest version: 1.0.8

# TaskWorker(任务调度器)

TaskWorker makes [WebWorkers][webworker] enjoyable. TaskWorker is a **tiny library (1.1kB)**, that removes the mental barrier of thinking about `postMessage` and hides the fact that you are working with workers.

At a more abstract level it is an RPC implementation for `postMessage` and [ES6 Proxies][es6 proxy].

```
$ npm install --save @kuiu/task-worker
```

## Introduction

On mobile phones, and especially on low-end mobile phones, it is important to keep the main thread as idle as possible so it can respond to user interactions quickly and provide a jank-free experience. **The UI thread ought to be for UI work only**. WebWorkers are a web API that allow you to run code in a separate thread. To communicate with another thread, WebWorkers offer the `postMessage` API. You can send JavaScript objects as messages using `myWorker.postMessage(someObject)`, triggering a `message` event inside the worker.

TaskWorker turns this messaged-based API into a something more developer-friendly by providing an RPC implementation: Values from one thread can be used within the other thread (and vice versa) just like local values.




**main.js**

```javascript
import * as TaskWorker from "@kuiu/task-worker";
async function init() {
  // WebWorkers use `postMessage` and therefore work with TaskWorker.
  const obj = TaskWorker.createTaskPorxy([new Worker("worker.js"), new Worker("worker.js")], [], null, true);
  alert(`Counter: ${await obj.counter}`);
  await obj.initial();
  alert(`Counter: ${await obj.counter}`);
}
init();
```

**worker.js**

```javascript
const obj = {
  counter: 0,
  inc() {
    this.counter++;
  },
};

const Worker = new TaskWorker.TaskWorker(self)
Worker.expose('default', obj);
```



**main.js**

```javascript
function callback(value) {
  alert(`Result: ${value}`);
}
async function init() {
  const remoteFunction = TaskWorker.createTaskPorxy([new Worker("worker.js")], [], null, true);
  await remoteFunction(TaskWorker.proxy(callback));
}
init();
```

**worker.js**

```javascript
async function remoteFunction(cb) {
  await cb("A string from a worker");
}
const Worker = new TaskWorker.TaskWorker(self)
Worker.expose('default', remoteFunction);
```