open-index/open-npm huggingface dataset:
npm package: @hydren/hdb
Description: custom db used in my projects i guess so
Author: ma4z
Latest version: 1.0.1


# @hydren/hdb

A super lightweight **flat-file JSON database** for Node.js.  
Stores your data in a single `.hdb` file, split into logical tables.  
Perfect for small projects, bots, or apps that don’t need a heavy SQL/NoSQL server.

---

## 📦 Installation

```bash
npm install @hydren/hdb
````

or with yarn:

```bash
yarn add @hydren/hdb
```

---

## ⚡ Quick Start

```js
const HDB = require("@hydren/hdb");

const db = new HDB("mydb.hdb", {
  USERS: [],
  SERVERS: [],
  SETTINGS: []
});

// Insert data
db.put("USERS", { id: 1, name: "Alice" });
db.put("USERS", { id: 2, name: "Bob" });

// Get one user
console.log(db.get("USERS", { id: 2 })); 
// -> { id: 2, name: "Bob" }

// Update user
db.update("USERS", { id: 2 }, { name: "Bobby" });

// List all users
console.log(db.list("USERS"));

// Delete user
db.delete("USERS", { id: 1 });

// Count rows
console.log("User count:", db.count("USERS"));
```

---

## 🔑 API Reference

### `new HDB(file, tables = {})`

Create a new database instance.

* **file**: path to `.hdb` file
* **tables** *(optional)*: object with table names as keys (will be created if missing)

---

### `list(table)`

Returns an array of all rows in a table.

### `put(table, obj)`

Appends a new row (object) to the table. Auto-creates the table if it doesn’t exist.

### `replace(table, list)`

Replaces the entire table with a new array of rows.

### `get(table, query)`

Finds the **first** row matching query.
Example:

```js
db.get("USERS", { id: 1 });
```

### `find(table, query)`

Finds **all rows** matching query.

```js
db.find("USERS", { name: "Alice" });
```

### `update(table, query, changes)`

Updates all rows that match the query.

```js
db.update("USERS", { id: 2 }, { name: "Bobby" });
```

### `delete(table, query)`

Removes all rows matching query.

```js
db.delete("USERS", { id: 1 });
```

### `clear(table)`

Wipes all rows from a table.

### `tablesList()`

Returns an array of all table names.

### `count(table)`

Returns the number of rows in a table.

---

## 📁 Example `.hdb` File

```txt
--TABLE-USERS--
{"id":1,"name":"Alice"}
{"id":2,"name":"Bobby"}
--TABLE-SERVERS--
{"id":"srv1","owner":1}
--TABLE-SETTINGS--
{"theme":"dark"}
```

---

## ✅ Use Cases

* Discord/Telegram bots
* Small web apps
* CLI tools
* Prototyping without a real DB

---

## ⚠️ Notes

* This is **not** designed for high concurrency or massive datasets.
* Data is stored as plain text; don’t use it for sensitive info.
* Each table is just newline-separated JSON objects.

---

## 📜 License

MIT © [Hydren](https://www.npmjs.com/~hydren)
npm package: @hydren/linkvertise
Description: Linkvertise or something..
Author: ma4z
Latest version: 1.0.2

# @hydren/linkvertise

A simple Node.js/Express helper for creating Linkvertise links and executing a callback when users complete the Linkvertise flow. Supports mounting routes as **Router** or directly on the **Express app**.
* Localhost testing may not work properly for some dynamic redirect flows; use a public domain or tunneling service like ngrok.

---

## Features

* Generate Linkvertise links dynamically.
* Detect current host and port automatically.
* Execute a callback **after the user returns from Linkvertise**.
* Mount routes as **Router** or directly on the **Express app**.

---

## Installation

```bash
npm install @hydren/linkvertise
```

---

## Usage

### 1. Configure your Linkvertise User ID

```js
const express = require("express");
const app = express();
const linkvertise = require("@hydren/linkvertise");

linkvertise.config("YOUR_USER_ID");
```

---

### 2. Using as Router

```js
function openahahha(req) {
  console.log("User completed Linkvertise:", req.ip);
  // Add logic to credit user, update DB, etc.
}

app.use(linkvertise.create({
  type: "router",
  path: "/go",
  finalPath: "/simple",
  onComplete: openahahha
}));

app.listen(3000, () => console.log("Server running on port 3000"));
```

* `/go` → Redirects user to Linkvertise.
* `/simple` → Executes `onComplete` after Linkvertise completion.

---

### 3. Using directly on App

```js
linkvertise.create({
  type: "app",
  instance: app,
  path: "/go2",
  finalPath: "/simple2",
  onComplete: openahahha
});
```

---

## Options

| Option     | Type                  | Description                                          |
| ---------- | --------------------- | ---------------------------------------------------- |
| type       | `'router'` or `'app'` | Mount type, default is `'router'`.                   |
| instance   | Express app/router    | Required if `type` is `'app'`.                       |
| path       | `string`              | Initial route to redirect user to Linkvertise.       |
| finalPath  | `string`              | Route where `onComplete` executes after Linkvertise. |
| onComplete | `function(req)`       | Callback executed when user returns.                 |

---

## Notes

* The module **cannot track Linkvertise server-side completion**, only detects **when the user is redirected back**.
* Dynamic host detection (`req.headers.host`) works on localhost or live servers.

---

## License

MIT License
npm package: @hydride0418/log-sdk
Description: Frontend log SDK with logid tracking for request tracing
Latest version: 1.0.0

# @garden/log-sdk

前端日志 SDK，提供 logid 生成、存储和请求拦截能力。

## 安装

```bash
npm install @garden/log-sdk
# 或
yarn add @garden/log-sdk
```

## 快速开始

```typescript
import { init, setupFetchInterceptor } from '@garden/log-sdk';

// 初始化（在应用入口调用）
init({ storage: 'session' });

// 设置 fetch 拦截器
setupFetchInterceptor();

// 之后所有 fetch 请求自动携带 X-Log-ID
fetch('/api/v1/chat', { method: 'POST', body: JSON.stringify(data) });
```

## API

### `init(options?)`

初始化 SDK。

```typescript
interface LogSDKConfig {
  storage?: 'session' | 'local';  // 默认 'session'
  headerName?: string;            // 默认 'X-Log-ID'
}

init({ storage: 'local', headerName: 'X-Request-ID' });
```

### `getLogId()`

获取当前 logid。如果不存在或无效，自动生成新的。

```typescript
const logId = getLogId();
console.log(logId); // "1710123456789_a1b2c3d4"
```

### `generateLogId()`

生成新的 logid。

```typescript
const newLogId = generateLogId();
```

### `resetLogId()`

重置 logid（生成新的并存储）。

```typescript
const newLogId = resetLogId();
```

### `setupFetchInterceptor()`

设置 fetch 拦截器，自动在所有请求中注入 `X-Log-ID` Header。

### `setupAxiosInterceptor(axios)`

设置 axios 拦截器。

```typescript
import axios from 'axios';
import { setupAxiosInterceptor } from '@garden/log-sdk';

setupAxiosInterceptor(axios);
```

## logid 格式

格式：`{timestamp_ms}_{random_8chars}`

示例：`1710123456789_a1b2c3d4`

- 前 13 位：毫秒级时间戳
- 后 8 位：随机十六进制字符

## License

MIT
npm package: @hydrofoil/alcaeus-forms
Description: Facilitates building forms to interact with Hydra APIs using Alcaeus
Author: Tomasz Pluskiewicz
Latest version: 0.1.1

> # `@hydrofoil/alcaeus-form`
> ## Automatically render forms for Hydra-driven operations
> [![Build Status](https://travis-ci.org/hypermedia-app/alcaeus-forms.svg?branch=master)](https://travis-ci.org/hypermedia-app/alcaeus-forms)
  [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=aVRRVXVJZVo0Q1BGcmtSZHVtWVk0VnJqcTdGVWp4ckR0NHhDS1UwOHRBND0tLVpEQnZYNUlkRnBOZmtCNkluVGNObWc9PQ==--d7cda2bf3ffd61f02693e1291022e521590360e4)](https://www.browserstack.com/automate/public-build/aVRRVXVJZVo0Q1BGcmtSZHVtWVk0VnJqcTdGVWp4ckR0NHhDS1UwOHRBND0tLVpEQnZYNUlkRnBOZmtCNkluVGNObWc9PQ==--d7cda2bf3ffd61f02693e1291022e521590360e4)
  [![codecov](https://codecov.io/gh/hypermedia-app/alcaeus-forms/branch/master/graph/badge.svg)](https://codecov.io/gh/hypermedia-app/alcaeus-forms)

## Installation

```
npm i --save @hydrofoil/alcaeus-forms
```

## Usage

Here's an example showing how form is used with [`lit-html`][lhtml]

```js
import { Hydra } from 'alcaeus'
import { html } from 'lit-html'
import '@hydrofoil/alcaeus-forms/alcaeus-form'

const resource = (await Hydra.loadResource('http://hydra-movies.herokuapp.com/')).root
const collection = resource.getCollections()[0]
resource.operations.find(op => op.method === 'POST')

const form = html`<alcaeus-form .operation="${operation}"></alcaeus-form>` 
```

[lhtml]: https://lit-html.polymer-project.org
npm package: @hydrofoil/alcaeus-loader
Description: Integrating @hydrofoil/hydrofoil-shell with Alcaeus Hydra client
Author: tpluscode
Latest version: 0.4.0-4

# alcaeus-loader

Hydra integration with [`<hydrofoil-shell>`][hs]

[hs]: https://github.com/hypermedia-app/hydrofoil-shell

## Installation

```
npm i --save alcaeus-loader alcaeus 
```
npm package: @hydrofoil/hydrofoil-paper-shell
Description: Material design hypermedia-driven web application
Author: tpluscode
Latest version: 0.2.0

# hydrofoil-paper-shell

A reusable [material design][mat] application shell, implemented as a [Polymer][Polymer] element. It composes
Polymer's `paper` elements .

[Polymer]: https://polymer-library.polymer-project.org
[mat]: https://material.io

## Installation

```
yarn add @hydrofoil/hydrofoil-paper-shell
```

To bundle with webpack, dynamic imports must also be enabled by adding `@babel/plugin-syntax-dynamic-import`.

## Usage

The shell element itself is API-agnostic. It produces the app skeleton but does not load resources from the
back-end. Please check the instructions of [hydrofoil-shell](https://github.com/hypermedia-app/hydrofoil-shell#using-the-element)

### Extending

Here's a live `hydrofoil-paper-shell`-based application in action


There are a number of slots, as shown on the screenshots below, which can be used to extend the shell:

1. `drawer-left`
1. `header`
1. `shell-ready`
1. `loader`
1. `toolbar-main`
1. `drawer-right`

![generic app](https://github.com/hypermedia-app/hydrofoil-paper-shell/raw/master/assets/paper-shell.png)
![generic app](https://github.com/hypermedia-app/hydrofoil-paper-shell/raw/master/assets/drawer-right.png)

To add multiple toolbar, use code like `<app-toolbar slot="drawer-left">`. Above this is how the "Select Hydra API" dropdown is added to the page.

The slot `shell-ready` is only displayed initially, before any resource is loaded from the API.

The slot `loader` is used inside a full-scree overlay, displayed while executing a server request.

## Helper elements

### `<hydrofoil-resource-accordion>`

Implementation of [HydrofoilMultiResourceView](https://github.com/hypermedia-app/hydrofoil-shell#hydrofoil-multi-resource-view)
which displays only one element in stack of collapsible panels

### `<hydrofoil-resource-tabs>`

Implementation of [HydrofoilMultiResourceView](https://github.com/hypermedia-app/hydrofoil-shell#hydrofoil-multi-resource-view)
which displays only one element inside `<paper-tabs>` element.

### `<loading-overlay>`

Container for the `loader` slot. Displayed as full-screen overlay when the resource is being loaded.

### `<hydrofoil-address-bar>`

Browser-like textbox, which can be used to manully type the resource identifier. Shown in the `header` slot above.

### `<alcaeus-entrypoint-menu>`

Main menu, which displays `paper-item` element for [Hydra entrypoint links](https://alcaeus.hydra.how/latest/api-documentation/entrypoint.html)