open-index/open-npm huggingface dataset:
npm package: @paolostyle/eslint-config
Description: Airbnb based ESLint config with Prettier formatting
Author: Paweł Dąbrowski
Latest version: 8.0.0

# @paolostyle/eslint-config
> Airbnb based ESLint config with Prettier formatting

## About

An ESLint config I've been using for a while (though not as a separate package) in React projects.
Heavily based on [Airbnb config](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb) with a bit less strict JSX a11y rules (which were copied almost completely from CRA ESLint config) and a bunch of changes in other rules - they are noted with `// *** Different from Airbnb` comment in `index.js`.

It also contains a config for TypeScript.

The config requires usage of [Prettier, aka the best thing that happened to frontend developers](https://prettier.io/). It doesn't enforce any settings (i.e. Prettier should be configured separately) but my personal config is:
```
"prettier": {
  "singleQuote": true,
  "printWidth": 100
}
```
and I heavily recommend it, especially the first part (`printWidth` of 100 is because the default 80 is definitely not enough for me).

It also includes linting rules for React hooks, so you should use React 16.8.0 or higher or disable them manually.

## Installation

### Base config
Install Prettier and ESLint if you don't have them installed yet:
```
yarn add --dev eslint prettier
```
This config uses a good amount of plugins, but they will all be installed as dependencies for ease of use and better compatibility, so you just have to run:
```
yarn add --dev @paolostyle/eslint-config
```
Then set `extends` field in your `.eslintrc.*` file or `eslintConfig` section in your `package.json`:
```
{
  "extends": "@paolostyle"
}
```
The last step is to add the Prettier config to your `package.json` file:
```
"prettier": {
  "singleQuote": true,
  "printWidth": 100
}
```

### TypeScript config
TypeScript config is included by default.

## License
[MIT](https://github.com/paolostyle/eslint-config/blob/master/LICENSE)
Copyright &copy; 2019 Paweł Dąbrowski
npm package: @paosder/gl-variable
Author: Paosder
Latest version: 0.1.1-alpha.3

# gl-variable


![thumbnail](./thumbnail.png)

Use webGL1 attribute and uniform easily.

## This is not documented yet, but type definitions are provided.

## Install
```shell
> yarn add @paosder/gl-variable @paosder/vector-map
```


## Usage

```typescript
const gl: WebGLRenderingContext = ...;
const program: WebGLProgram = ...;

const cubes: GLVariable = createGLVariable(gl, program, {
  surface: {
    name: 'a_surface',
    type: 'attribute',
    size: 3,
    length: 24,
    usage: gl.STATIC_DRAW,
    defaultData: points,
  },
  color: {
    name: 'a_color',
    type: 'attribute',
    size: 4,
    usage: gl.DYNAMIC_DRAW,
    length: DEFAULT_CUBE_LENGTH,
    instanced: 1,
  },
  position: {
    name: 'a_position',
    type: 'attribute',
    size: 3,
    usage: gl.DYNAMIC_DRAW,
    length: DEFAULT_CUBE_LENGTH,
    instanced: 1,
  },
  rotation: {
    name: 'a_rotation',
    type: 'attribute',
    size: 4,
    matrix: true,
    usage: gl.DYNAMIC_DRAW,
    length: DEFAULT_CUBE_LENGTH,
    instanced: 1,
  },
  size: {
    name: 'a_size',
    type: 'attribute',
    size: 1,
    usage: gl.DYNAMIC_DRAW,
    length: DEFAULT_CUBE_LENGTH,
    instanced: 1,
  },
});

interface SomeOptions {
    color: Color;
    position: Coordinate;
    rotation: RotationMat;
    size: [number];
}

const options: SomeOptions = { ... };
const id = 'test-object';

addObject(cubes, id, options);

getAttribArray(cubes, id, 'position', (bufferArr: Float32Array) => {
  bufferArr[0] = 1; // change subarray data.
  bufferArr[1] = 0;
  bufferArr[2] = 1;

  return true; // we should return true when we change data and wants to refresh.
});

// Update variable. We should call this function after VAO is plugged in.
updateVariable(gl, program, cubes);

```

## API
npm package: @paotuan/adapter-kook
Description: KOOK (开黑啦) Adapter for Satorijs
Author: Shigma
Latest version: 4.5.2-1

# [@satorijs/adapter-kook](https://koishi.chat/plugins/adapter/kook.html)

KOOK (开黑啦) adapter for [Satori](https://github.com/satorijs/satori).

- [Documentation](https://koishi.chat/plugins/adapter/kook.html)
npm package: @paotuan/adapter-qq
Description: QQ Adapter for Satorijs
Author: Shigma
Latest version: 4.5.1-4

# [@satorijs/adapter-qq](https://koishi.chat/plugins/adapter/qq.html)

QQ / QQ Guild adapter for [Satori](https://github.com/satorijs/satori).

- [Documentation](https://koishi.chat/plugins/adapter/qq.html)
npm package: @papa-lang/core
Description: TypeScript SDK for papa-lang AI-native ecosystem
Latest version: 0.1.0

# @papa-lang/core

TypeScript SDK for the papa-lang AI-native ecosystem: orchestrate, RAG, and guard types.

## Install

```bash
npm install @papa-lang/core
```

## Usage

```ts
import { PapaClient } from "@papa-lang/core";

const client = new PapaClient("https://api.papa-ai.ae", process.env.PAPA_API_KEY);

const result = await client.orchestrate("What is papa-lang?");
console.log(result.response, result.verdict);

const rag = await client.ragSearch("documentation");
console.log(rag.context);
```

## Exports

- `PapaClient` — HTTP client for `orchestrate()` and `ragSearch()`
- Types: `OrchestrateResult`, `SwarmResult`, `HRSScore`, `GuardResult`, etc.

## License

MIT
npm package: @papa-sports/web-tracing-vue2
Description: 基于 JS 跨平台插件，为前端项目提供【 埋点、行为、性能、异常、请求、资源、路由、曝光、录屏 】监控手段 - vue2版本
Author: M-cheng-web
Latest version: 2.0.14

<div align="center">
  <img src="https://github.com/M-cheng-web/image-provider/raw/main/web-tracing/logo.7k1jidnhjr40.svg" width="128" alt="logo" />
  <h1>web-tracing 监控插件 - vue2版本</h1>
  <p>
    基于 JS 跨平台插件，为前端项目提供【 埋点、行为、性能、异常、请求、资源、路由、曝光、录屏 】监控手段
  </p>
</div>

## 官方文档
[官方文档 https://m-cheng-web.github.io/web-tracing/](https://m-cheng-web.github.io/web-tracing/)

## 示例项目(本地)
[js版本 https://github.com/M-cheng-web/web-tracing-examples-js](https://github.com/M-cheng-web/web-tracing-examples-js)

[vue2版本 https://github.com/M-cheng-web/web-tracing-examples-vue2](https://github.com/M-cheng-web/web-tracing-examples-vue2)

[vue3版本 https://github.com/M-cheng-web/web-tracing-examples-vue3](https://github.com/M-cheng-web/web-tracing-examples-vue3)

## 演示
### 事件监听
<img src="https://cdn.staticaly.com/gh/M-cheng-web/image-provider@main/web-tracing/image.78d02ro0pyo0.webp" width="1200" alt="logo" />

### 错误监听
<img src="https://cdn.staticaly.com/gh/M-cheng-web/image-provider@main/web-tracing/Jul-31-2023-20-41-51.4dr4i0vaypw0.gif" width="1200" alt="logo" />

### 资源监听
<img src="https://cdn.staticaly.com/gh/M-cheng-web/image-provider@main/web-tracing/image.6he8u6xbh000.webp" width="1200" alt="logo" />


## 项目初衷
为了帮助开发们在公司平台上搭建一套前端监控平台

> 作者心声: 想降低一下前端在这方面耗费的时间与精力，此项目会尽量针对每个场景都提供解决方案；即使最后没用我这套，但从在这里对某些场景方案有了一些了解，我也很开心

## 亮点
提供了多种定制化api最大限度帮助你应付各个场景的业务，例如:
+ 提供钩子函数让你对数据精确把握
+ 提供本地化选项api，让开发手动控制去发送监控数据 - 节省带宽
+ 提供批量错误api，在遇到无限错误时融合批量错误信息 - 节省带宽
+ 提供抽样发送api - 节省带宽
+ 提供 错误/请求 事件的过滤api
+ 等等....

站在技术角度，因为明确此项目可能更多的是应用在公司平台上，大概率会二开，所以作者对项目结构以及代码都严格要求
+ 架构 - demo、核心sdk代码、文档都在同一个项目中，调试、部署都很方便
+ 封装 - sdk存在大量的重写或者监听，对此有统一流程
+ 响应式 - 项目内部实现了vue响应式，也应用在 options 对象中，相信你接触会后受益良多
+ 多版本 - 针对不同平台提供多个版本(目前只有js、vue2、vue3)，受益于monorepo架构可一键发布
+ 内聚 - 目前核心功能的所有代码都没有分包，虽然monorepo架构支持，但作者认为目前分包不利于代码阅读以及二开方便
+ 文档/注释 - 完善的文档以及非常全的注释，力求帮助你快速了解这一切

## 未来方向
会写一套服务端(nest) + 后台查看监控数据平台(vue)，有以下几点考量
+ 提供服务端能力（目前只是在采集端发力）
+ 可以在线体验此项目
+ 提供更多示例代码给开发们，再次降低这一套代码在公司的推广难度
+ 作者也想站在业务的角度多思考还能从哪些方面此项目还缺失哪些功能

针对首屏加载的监控做出更多精细化的东西，例如考虑sdk的绝对轻量化

## 加入我们
<img align="left" width="180" src="https://cdn.staticaly.com/gh/M-cheng-web/image-provider@main/web-tracing/image.18h5172x1bk0.webp" />

- 如果对此项目有疑虑或者有优化点，欢迎进群讨论
- Bug 反馈请直接去 Github 上面提 Issues，我会实时收到邮件提醒前去查看

<br/>
<br/>
<br/>
<br/>
<br/>

## 🙏🙏🙏 点个Star

**如果您觉得这个项目还不错, 可以在 [Github](https://github.com/M-cheng-web/web-tracing) 上面帮我点个`star`, 支持一下作者ヾ(◍°∇°◍)ﾉﾞ**

<br/>

## 特别感谢
+ [xy-sea](https://github.com/xy-sea)为我提供了很多好主意，这是他的关于[监控平台文章以及blog](https://github.com/xy-sea/blog/blob/main/markdown/%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%E5%89%8D%E7%AB%AF%E7%9B%91%E6%8E%A7%E5%B9%B3%E5%8F%B0%EF%BC%8C%E9%9D%A2%E8%AF%95%E5%BF%85%E5%A4%87%E7%9A%84%E4%BA%AE%E7%82%B9%E9%A1%B9%E7%9B%AE.md)，写的很好受益匪浅
+ [wangshitao929@163.com](wangshitao929@163.com)
npm package: @papabravocorp/pluggable-logger
Description: A pluggable logger for Node.js that writes structured logs to local file systems, Azure ADLS, or custom storage backends.
Author: Prabodh Bharose
Latest version: 1.0.4

# pluggable-logger
pluggable-logger is a modular logging utility for JavaScript/TypeScript applications, supporting structured log output to file systems, cloud storage like Azure Data Lake Storage (ADLS Gen2), or any custom-defined destination. Ideal for applications that need flexible, scalable, and cloud-ready logging pipelines.
npm package: @papack/api
Description: Minimal, opinionated HTTP API core for people who want full control over IO, parsing, streaming, and errors.
Author: Matthias Steiner
Latest version: 1.1.2

# @papack/api

Minimal, opinionated HTTP API core for people who want full control over IO, parsing, streaming, and errors.
No magic. No Hooks. No implicit parsing.

Context is explicitly extensible. You can attach schemas, business logic, services, or infrastructure once, and they are available on ctx in every handler, you dont need hooks.

## Core Rules

- Transport is dumb. handlers decide everything.
- `ctx.req.body` is **always string** (if present).
- Body is read **exactly once** by the core.
- Parsing is **never** automatic.
- Streaming stays streaming.

## Context

- App context is injected once
- Available in **all** handlers
- No mutation rules enforced

```ts
const api = new Api({ value: "from-context" });
```

## Design Intent

- Zero hidden transformations
- Predictable transport semantics
- Streaming stays streaming
- Parsing is a user decision

## RPC

- `POST` only
- `req` **is** the API surface
- Return value will be strinifyed with `JSON.stringify`

```ts
server.rpc("/rpc", (ctx) => {
  return {
    raw: ctx.req.body,
    value: ctx.value,
  };
});
```

## SSE

- `GET` only
- Real `text/event-stream`
- Explicit `emit()`
- Guaranteed `onCleanup()` on disconnect

```ts
server.sse<{ tick: number }>("/events", (ctx) => {
  let i = 0;
  const id = setInterval(() => {
    ctx.emit("tick", i++);
  }, 1000);

  ctx.onCleanup(() => {
    clearInterval(id);
  });
});
```

## Blob (raw by design)

- Return `Buffer | Readable`
- No headers added
- No `Content-Type` guessing
- Streams use `Transfer-Encoding: chunked`
- Full backpressure control

```ts
server.blob("/file", () => {
  return fs.createReadStream("./big.bin");
});
```

## Upload

- `POST` only
- Request body is **binary**
- `ctx.req` is a `Readable`
- Core does **not** read or buffer
- No `ctx.req.body`
- No multipart assumptions

```ts
server.upload("/upload", async (ctx) => {
  for await (const chunk of ctx.req) {
    // stream processing
  }

  return "OK";
});
```

## CORS

CORS is handled centrally by the core when enabled at instantiation.
If configured, the server:

- sets `Access-Control-Allow-Origin` to a **concrete origin**
- enables `Access-Control-Allow-Credentials` for session cookies
- responds to `OPTIONS` preflight requests with `204`

```ts
const api = new Api(ctx, {
  cors: {
    origin: "http://localhost:5173",
  },
});
```

## Errors

- Explicit `HttpError`s only
- Status code + stable `"ERROR_CODE"`
- No messages
- No leaking

Examples:

```
"NOT_FOUND"
"METHOD_NOT_ALLOWED"
"BAD_REQUEST"
```
npm package: @papack/bus
Description: Lightweight async message bus with fire-and-forget events and typed RPC calls
Author: Matthias Steiner
Latest version: 1.0.0

# @papack/bus

Lightweight async message bus with **fire-and-forget events** and **typed RPC calls**.
Zero dependencies. Fully TypeScript.

## Features

- `send()` — broadcast to all listeners (non-blocking)
- `call()` — request/response to exactly one listener (awaits result)
- `on()` — register listener
- `once()` — auto-unregister after first call
- `off()` — remove listener (topic auto-cleanup)
- Random routing when multiple RPC listeners exist
- Type-safe payloads and return types per topic
- Support CJS and ESM

## Example

```ts
import { Bus } from "@papack/bus";

type Topic = "log" | "calc";

const bus = new Bus<Topic>();

bus.on("log", async (msg) => console.log(msg));
bus.on("calc", async (n) => n * 2);

bus.send("log", "Hello");
const result = await bus.call<number, number>("calc", 21);
console.log(result); // 42
```

## Roadmap

### v1.1.0 Node Port

- an implementation of the BusPort that work in multiprocess Node
- use like `const bus = new ClusterBus()`

### v1.2.0 Redis Port

- an implementation of the BusPort that work with Redis
- inject Redis client to keep 0 Dependencys
- use like `const bus = new RedisBus({client:redisClient})`

## Future

Idea: a Gossip Port for peer-to-peer message propagation using a gossip protocol.
npm package: @papack/client
Description: Minimal HTTP client utilities for the browser.
Author: Matthias Steiner
Latest version: 1.0.3

# @papack/client

Minimal HTTP client utilities for the browser.

Provides exactly two primitives:

- `call` - JSON-first POST requests with predictable error handling
- `sse` - thin wrapper around `EventSource`

No abstractions beyond what the platform already gives you.

## Install

```bash
npm install @papack/client
```

## API

### call

Typed POST request helper.

```ts
import { call } from "@papack/client";

const result = await call<User>("/api/user", { id: 1 });
```

#### Behavior

- Always uses `POST`
- Automatically sets `Content-Type: application/json`
- Merges custom `fetch` options
- Sends `data` as JSON (if provided)
- Reads response as text first
- Parses JSON when possible
- Falls back to raw text

#### Error handling

- Non-OK responses throw the response body (text) if available
- Network or parsing failures throw string errors
- No wrapped error objects
- No silent failures

You either get a value or a thrown error.

### sse

Thin wrapper around `EventSource`.

```ts
import { sse } from "@papack/client";

const events = sse("/api/events");

events.onmessage = (e) => {
  console.log(e.data);
};
```
npm package: @papack/log
Description: A simple async logger with typed log levels
Author: Matthias Steiner
Latest version: 1.0.0

# @papack/log

A simple async logger with **typed log levels**, **timestamped output**, and a clean **port-and-adapter architecture** for interchangeable implementations.
Built with TypeScript and **0 dependencies**.

## Features

- Structured logging via `trace()`, `info()`, `warn()`, and `err()`
- Configurable log level on instantiation: `"trace" | "info" | "warn" | "err"`
- Messages below the configured level are automatically filtered out
- Zero dependencies — portable, embeddable, and safe for small runtimes
- Implementation-agnostic design: adapters (`CliLogger`, `BrowserLogger`, `NullLogger`, File, Remote, …)
- Implementation can be swapped without code changes

## Examples

### CLI / Terminal

To produce this log:

```
2025-02-14T22:24:03.447Z [INFO] prod-node2(5193): main.ts: server started
```

use this code:

```ts
import { CliLogger } from "@papack/log";

const log = new CliLogger({ loglevel: "info" }); // minimum level is "info"

log.info("main.ts", "server started");
```

### Browser Example

```ts
import { BrowserLogger } from "@papack/log";

const log = new BrowserLogger({ loglevel: "info" });

log.warn("app.ts", "API latency high");
```

The browser prints the same timestamped format, but using CSS instead of ANSI Color and do not include proccess id or hostname.

### Silent Mode

If you want to disable logging without changing your application logic:

```ts
import { NullLogger } from "@papack/log";

const log = new NullLogger();
```

All log calls are discarded with near-zero overhead.

## Roadmap

### v1.1.0 — FileLogger

- Write logs to the filesystem
- Automatic logfile rotation

### v1.2.0 — Remote Log

- Each log entry receives a UUID and is exposed via HTTP
- JSON data structure instead of human-readable format ([{uuid,time,host,pid,msg}])
- Dedicated listening port
- API-key authentication
- A included `RemoteLogCollector` function can be used on a remote host
  - acknowledges collected entries by returning the UUID
- Exposes metrics: number of trace, info, warn, and err entries

### v1.3.0 — Remote Cluster Log

- Same as Remote Log, but compatible with Node.js Cluster mode
- Full multi-adapter compatibility
npm package: @papack/metric
Description: Minimal TypeScript runtime and application metrics
Author: Matthias Steiner
Latest version: 1.0.0

# @papack/metric

TypeScript metrics for developers who want minimal runtime and application metrics.

## Installation

```bash
npm install @papack/metric
```

## Concept

The package is built around a single abstraction:

```ts
interface MetricPortInterface<K extends string = string> {
  set(key: K, value: number | ((prev: number) => number)): void;
  snapshot(): Record<K, number>;
}
```

Anything that collects metrics implements this interface.

At the moment two concrete implementations are provided:

- **Metric** - in-memory application metrics, includes no metric
- **RuntimeMetric** - minimal runtime and system metrics

You can swap them freely via the interface.

## Metric (application metrics)

Use `Metric` for any number value.

### Example

```ts
import { Metric } from "@papack/metric";

const metric = new Metric(["REQUESTS_TOTAL", "ERRORS_TOTAL"] as const);

metric.set("REQUESTS_TOTAL", 1);
metric.set("REQUESTS_TOTAL", (v) => v + 1);
metric.set("ERRORS_TOTAL", 0);

const snapshot = metric.snapshot();
// {
//   REQUESTS_TOTAL: 2,
//   ERRORS_TOTAL: 0
// }
```

### Properties

- Keys are fixed and enforced at compile time
- Unknown keys throw immediately
- `snapshot()` always returns a full object

## RuntimeMetric

`RuntimeMetric` collects application and OS-level metrics and allows you to extend them with custom keys.

### Default Metrics

```ts
UPTIME_SECONDS;
LOOP_PRESSURE;
LOAD_1M;
LOAD_5M;
LOAD_15M;
TOTAL_MEMORY_BYTES;
FREE_MEMORY_BYTES;
HEAP_USED_BYTES;
RSS_BYTES;
```

### Example

```ts
import { RuntimeMetric } from "@papack/metric";

const metric = new RuntimeMetric(["REQUESTS_TOTAL"]);

metric.set("REQUESTS_TOTAL", 1);

const snapshot = metric.snapshot();
// {
//   UPTIME_SECONDS: number,
//   LOOP_PRESSURE: number,
//   LOAD_1M: number,
//   LOAD_5M: number,
//   LOAD_15M: number,
//   TOTAL_MEMORY_BYTES: number,
//   FREE_MEMORY_BYTES: number,
//   HEAP_USED_BYTES: number,
//   RSS_BYTES: number,
//   REQUESTS_TOTAL: number
// }
```
npm package: @papack/schema
Description: Simple Schemas are with all-required or all-optional and values never allow null/undefined
Author: Matthias Steiner
Latest version: 1.3.1

# @papack/schema

Opinionated, fully synchronous TypeScript schemas for developers who want strict, minimal, predictable data structures.  
No nulls. No undefined. No async. No partial optionality.

## Core Rules

- **Sync only** — no Promises anywhere.
- **First error wins** — `validate()` throws immediately.
- **Objects are all-required or all-optional** — never mixed.
- **No null/undefined** —
  - values: `""` or `0`
  - lists: `[]`
- **Only `validate()`** — no `parse`, no `safeParse`.
- **Strong typing** — `Infer<T>` extracts exact static types.
- **Describe** — inspect schema for UI forms, etc.
- **Checks** — curried, functional; includes `char(n)`, `isPassword`, `isIban`, etc.
- **Union checks** — support primitive unions, never object unions.

## Installation

```sh
npm install @papack/schema
```

## Concept

With the three primitives — `object`, `list`, `value` — you can express any structure.
Strict, lightweight, zero magic.

---

# Examples

## Basic schema

```ts
import { object, value, isString } from "@papack/schema";

const UserSchema = object({
  name: value(isString),
});

UserSchema.validate({ name: "Max" });
```

---

## Complete example

```ts
import {
  value,
  object,
  partial,
  pick,
  omit,
  Infer,
  isUnionList,
  isPassword,
  isString,
  extend,
  isBoolean,
} from "@papack/schema";

const UserSchema = object({
  name: value(isString)

  pw: value(
    isPassword({
      minLength: 8,
      minNumbers: 1,
      minSpecialChars: 1,
    })
  ),

  gender: value(isUnionList(["w", "m"], { allowEmpty: true })),
});

// Derived schemas
const a = pick(UserSchema, ["name"]);
const b = omit(UserSchema, ["name"]);
const c = partial(UserSchema);

// Extended schema
const d = extend(UserSchema, {
  locked: value(isBoolean),
});

// Final schema
const e = omit(d, ["name"]);
type User = Infer<typeof e>;

const u: User = {
  gender: ["m", "m"],
  locked: false,
  pw: "asdfias2df!sadfed",
};

d.validate(u);
```

---

## Using `describe()`

```ts
const info = UserSchema.describe();
// Structural metadata for:
// - UI form builders
// - tools, automation, codegen
```

## Errors

Errors are short, stable, and i18n-ready.
Examples:

- `"TOO_SMALL"`
- `"NOT_STRING"`
- `"INVALID_UNION"`

`validate()` throws always on the **first** error.

## Design Intent

- Minimal surface, predictable behavior.
- No hidden transformations.
- No optional-field chaos.
npm package: @papack/session
Description: Minimal session handling for node:http.
Author: Matthias Steiner
Latest version: 1.0.1

# @papack/session

Minimal session handling for `node:http`.  
Async-first, in-memory, zero dependencies.

Designed for small–medium services and internal tools where explicit control
and predictable behavior matter more than abstraction.

## Features

- Secure cookie-based sessions
- 2-token model (public cookie token + internal UUID)
- Cryptographically secure IDs
- Sliding expiration
- Manual logout and admin destruction
- Predicate-based admin lookup

## Installation

```bash
bun add @papack/session
# or
npm install @papack/session
```

## Usage

```ts
import http from "node:http";
import { Session } from "@papack/session";

type MySession = {
  userId?: string;
};

const session = new Session<MySession>({
  initialData: {},
  expiryMinutes: 30,
  secureCookie: false, // true in production
});

http
  .createServer(async (req, res) => {
    const data = await session.get(req, res);

    if (req.url === "/login") {
      await session.set(req, res, () => ({ userId: "42" }));
      res.end("ok");
      return;
    }

    if (req.url === "/logout") {
      await session.logout(req, res);
      res.end("bye");
      return;
    }

    res.end(JSON.stringify(data));
  })
  .listen(3000);
```

---

## Security Model

- Cookie contains a public token only
- Internal session UUID never leaves the server
- Unknown or invalid cookies result in a new session

---

## Admin API

```ts
await session.getSessionCount();
await session.findSessions((data) => data.userId === "42");
await session.destroy(uuid);
```

## Cookies

- `HttpOnly`
- `SameSite=Strict`
- `Secure` configurable
- Fixed name: `ssid`

## Expiration

- Sliding expiration on access
- Configurable in minutes
- Background cleanup interval
npm package: @papack/ssg
Description: Minimal static site generator with JSX to File rendering
Author: Matthias Steiner
Latest version: 0.1.0

# @papack/ssg

Minimal static site generator with JSX to File rendering.

## Core Idea

- Components can be `async`
- One-shot rendering (SSG -> static files)
- No state, no reactivity, no hydration
- Every route is just a function

## Install

```bash
npm install @papack/ssg
```

## Quick Start

```ts
import { StaticSiteGenerator } from "@papack/ssg";

const gen = new StaticSiteGenerator({
  out: "./dist",
  ctx: { siteName: "Example" },
});

gen.html("/", async (ctx) => {
  return <h1>{ctx.siteName}</h1>;
});

await gen.run();
```

## Routes

### html

```ts
gen.html("/", () => <Home />);
gen.html("/blog", () => <Blog />);
gen.html("/about.html", () => <About />);
```

Path mapping:

- `/` -> `index.html`
- `/blog` -> `blog/index.html`
- `/about.html` -> exact file

### css / js

```ts
gen.css("/style.css", () => "body {}");
gen.js("/app.js", () => "console.log('hi')");
```

- file extension required
- returns plain strings
- no bundling

### public / file

```ts
gen.public("/", "./public");
gen.file("/cv.pdf", "./cv.pdf");
```

### notFound

```ts
gen.notFound(() => <h1>404</h1>);
```

Generates `404.html`.

## JSX Helpers

### `<For />`

```ts
<For each={items}>{(item) => <li>{item}</li>}</For>
```

- single render function
- no keys, no diffing
- SSR-only

### `<Show />`

```ts
<Show when={visible}>
  <Content />
</Show>
```

Controls existence, not visibility.

## Context (`ctx`)

```ts
new StaticSiteGenerator({
  out: "./dist",
  ctx: { api, version: "1.0" },
});
```
npm package: @papack/ssr
Description: Minimal server-side rendering framework
Author: Matthias Steiner
Latest version: 0.1.0

# @papack/ssr

Minimal server-side rendering framework with JSX-to-string rendering.

## Core Idea

- JSX rendered directly to HTML strings
- Components can be async
- No client-side JavaScript required
- No state, no reactivity, no hydration
- Every route is a plain function
- Built on Node.js `http`

> **SSR only**. request -> render -> response.

## Install

```bash
npm install @papack/ssr
```

## Quick Start

```ts
import { Router } from "@papack/ssr";

const router = new Router({
  siteName: "Example",
});

router.html({ path: "/" }, (ctx) => {
  return <h1>{ctx.siteName}</h1>;
});

router.listen(3000);
```

## Routing

### HTML

```ts
router.html({ path: "/product/:id" }, (ctx) => {
  return <h1>Product {ctx.params.id}</h1>;
});
```

- Returns HTML
- `<!DOCTYPE html>` is added automatically
- `Content-Type: text/html; charset=utf-8`

### CSS

```ts
router.css({ path: "/styles/main.css" }, () => {
  return `
    body { font-family: system-ui; }
  `;
});
```

- Returns plain strings
- `Content-Type: text/css; charset=utf-8`

### JavaScript

```ts
router.js({ path: "/scripts/app.js" }, () => {
  return `console.log("loaded");`;
});
```

## Params

```ts
router.html({ path: "/blog/:slug" }, (ctx) => {
  return <h1>{ctx.params.slug}</h1>;
});
```

## Context (ctx)

```ts
const router = new Router({
  db,
  version: "1.0",
});
```

```ts
(ctx) => {
  ctx.req; // IncomingMessage
  ctx.res; // ServerResponse
};
```

## JSX Rendering

### Async Components

```ts
async function User({ id }) {
  const user = await db.getUser(id);
  return <p>{user.name}</p>;
}
```

### `<For />`

```tsx
<For each={items}>{(item) => <li>{item}</li>}</For>
```

- Single render function
- No keys
- No diffing
- SSR-only

### `<Show />`

```tsx
<Show when={loggedIn}>
  <Dashboard />
</Show>
```

## Error Handling

### 404

```ts
router.notFound(() => {
  return <h1>Not Found</h1>;
});
```

### 500

```ts
router.error((ctx, err) => {
  return (
    <>
      <h1>Error</h1>
      <pre>{String(err)}</pre>
    </>
  );
});
```

## Cookies / Headers

```ts
router.html({ path: "/login" }, (ctx) => {
  ctx.res.setHeader("Set-Cookie", "session=abc; Path=/; HttpOnly");

  return "ok";
});
```

## Sessions

**@papack/ssr** works well with **@papack/session**. Rendering is strictly request-based, while sessions are handled explicitly via cookies at the `node:http` level. Session data is available through `ctx.req` and `ctx.res`, fitting naturally into the request -> render -> response flow without implicit state.

## Cache

**@papack/ssr** intentionally has no built-in caching. If caching is required, **@papack/cache** can be added explicitly on top to store rendered output or data, keeping cache behavior opt-in and the core SSR model predictable.
npm package: @papack/storage
Description: Simple TypeScript async Object Storage library.
Author: Matthias Steiner
Latest version: 1.0.1

# @papack/storage

Simple TypeScript async **Object Storage library**.
Store, read, and delete files using **Buffers or Streams**.  
Zero dependencies at the core. Fully typed.

## Features

- `write([stream or buffer]):Promise<uuid>` - store a file (Buffer or Stream)
- `read(uuid, {output: "buffer" | "stream"})` - load a file (Buffer or Stream); can throw
- `exists(uuid)` - check if an object exists - can throw
- `delete(uuid)` - remove an object - can throw
- Port/Adapter architecture for fully swappable backends
- In-memory implementation included (ideal for tests)
- Works with both CJS and ESM
- Fully TypeScript

## Example

```ts
import { FileStorage } from "@papack/storage";
const storage = new FileStorage({
  basePath: "./data",
  maxFileSizeInMegaByte: 2,
});

await storage.write(Buffer.from("Hello World"));
const buffer = await storage.read(uuid);
console.log(buffer.toString()); // Hello World
```

## Alternative Implementations

### MemoryStorage

- Keeps files in RAM eg. for unit tests

```ts
import { MemoryStorage } from "@papack/storage";
const storage = new MemoryStorage({ basePath: "./data" });
```

## FAQ

### What happens to metadata and filenames?

Only UUIDs are supported.  
The storage layer does not track filenames, MIME types, timestamps, or any additional metadata.  
If metadata is needed, it must be managed by the application (e.g. in a database).

### Stream or Buffer?

`write()` accepts both.  
If a Buffer is passed, it is internally converted to a stream. If a Stream is passed, it is forwarded as-is.

`read()` returns a Buffer by default.  
If streaming is required, use the option `read(uuid, {output:"stream"})`, which returns a Readable stream without buffering the entire object in memory.

### Does `write()` support lazy size checking for streams?

Yes, when writing a stream, its size is monitored during consumption.
If the configured maximum file size is exceeded, the write operation is terminated immediately and the object is discarded.

## Roadmap

### v1.1.0 — S3 Adapter

- Official S3 adapter as a separate package
- Uses an injected S3 client to maintain zero dependencies
- Example: `new S3Adapter({ client: s3, bucket: "my-bucket" })`

## Future Ideas

- **Bittorrent-sync-based adapter** for decentralized file sharing without a central server
- **SHA-256 based deduplication** detect identical objects before storing
npm package: @papaemmelab/isabl-report
Description: Frontend to visualize results for MSK Kids Reports and RNA Data Expression at cohort level.
Author: Juan E. Arango
Latest version: 0.1.77

# Isabl Reports

Frontend to visualize results for MSK Kids Reports and RNA Data Expression at cohort level.

## How to use

```sh
nvm use v18.16.1     # Use a node working version
npm install -g yarn  # Install yarn

yarn install     # Install dependencies
yarn dev         # Run web server
```

You might need to add your **isabl auth token** to the the browser local storage for development purposes:

```js
// Run in your browser console
localStorage.setItem('user-token', <your-isabl-auth-token>)
```

## Setup backend

You need an isabl backend to run the dashboard.

```sh
# Clone Repo and checkout to the proper branch
git clone https://github.com/papaemmelab/isabl_msk
cd isabl_msk
git checkout isabl_dashboard # or `master` or the branch you want to use

# Build containers and run (uses -f local.yml by default)
docker-compose build
docker-compose up -d

# See the logs
docker-compose logs -f
```

### Create Test Data for development

- For the **RNA Dashboard**:

You might need to get these 3 files from production, which you can find in a `SALMON_GENCODE` Project-level Application (`gene_level.feather`), and in a `WGTS_REPORT` Project-level Application (`tsne_blood.feather` and `tsne_solid.feather`)

```text
isabl_msk
└── isabl_dashboard
  └──  tests
    └── data
      ├── gene_level.feather
      ├── tsne_blood.feather
      └── tsne_solid.feather
```

- For the **PTMP Reports**:

You need to create both new `Inviduals` and `WGTS_REPORT (3.0.0)` Individual-level `Analyses` with `json` results for report, where you link it to a real report file from production.

For example:

1. Copy real json results from `WGTS_REPORT` in production:

    ```text
    isabl_msk
    └── isabl_dashboard
      └──  tests
        └── data
          ├── DEV_000001.json
          ├── DEV_000002.json
          └── DEV_000003.json
    ```

2. Create a new Application with name `WGTS_REPORT` and version `3.0.0`
3. Create a new Individual. i.e `Individual(DEV_000001)`.
4. Create a new Analysis, whose Project-level key is the new Individual and the new Application you just created. Set its status to `SUCCEEDED`, and finally link the json file to its results:

    ```json
    {
        "json": "/app/isabl_dashboard/tests/data/DEV_000001.json"
    }
    ```

    Note: The `/app` location is where the `isabl_msk` code its located inside the docker compose container.

#### You should be now ready to go! 🚀

### 📦 Deploy to NPM

```bash
yarn deploy
```
npm package: @papagrigoriouc/todo-cli
Description: CLI tool for managing a to-do list with Node.js, storing data in a JSON file, colorized output (chalk), and tables (cli-table3).
Author: Christoforos Papagrigoriou
Latest version: 2.0.0

# Kandu To‑Do CLI

CLI tool for managing a to-do list with Node.js, storing data in a JSON file, colorized output (chalk), and tables (cli-table3).

## Installation (local development)
```bash
npm install
npm link
```
Then run:
```bash
todo --help
```

## Install globally from NPM (after publishing)
```bash
npm install -g <package-name>
```

## Usage
```bash
todo add "Buy groceries"
# => Todo added successfully with ID: 1

todo show all
# => Displays a table with todoId, todoDescription, todoStatus

todo update {todoId} completed
# => Todo 1 status updated to completed

todo delete {todoId}
# => Todo with ID 1 has been deleted successfully.

todo delete 100
# => Error: Todo with ID 100 not found.
```

## Notes
- Data is stored in `todos.json` at the package root.
- Allowed statuses: `pending`, `completed`.
- Help command: `todo --help`.
- Node 18+.

## Publishing to NPM
1. Create an npm account: `npm adduser` (or `npm login`).
2. Change the `name` in `package.json` to something unique (e.g., `@username/todo-cli` or any unique name).
3. Bump the `version` if you republish.
4. Run `npm publish` (or `npm publish --access public` for a scoped package).

## Quick checks/tests
- Test empty edge cases (empty description, wrong id, invalid status).
- Test multiple add/delete/update operations.
- Optionally add unit tests later.
npm package: @papakapa/nest-database-module
Description: NestJS Dynamic Database module
Author: Kiryl Kapustsin
Latest version: 0.1.0

<h1 align="center"></h1>

<div align="center">
  <a href="http://nestjs.com/" target="_blank">
    <img src="https://nestjs.com/img/logo_text.svg" width="150" alt="Nest Logo" />
  </a>
</div>

<h3 align="center">Nest Js Database Modules</h3>

<div align="center">
  <a href="https://nestjs.com" target="_blank">
    <img src="https://img.shields.io/badge/built%20with-NestJs-red.svg" alt="Built with NestJS">
  </a>
<a href="https://www.npmjs.com/package/@papakapa/nest-database-module">
    <img src="https://img.shields.io/badge/papakapa-npm-4ba0f6" />
  </a>

</div>

# Get started

## Installation

Install via NPM:

```shell
npm install uploader
```

Or via YARN:

```
yarn add uploader
```

## Usage

### Postgres

Declare module:

```typescript
@Module({
  imports: [
    PostgresModule.forRootAsync({
      imports: [],
      inject: [],
      useFactory: () => ({
        host: 'localhost',
        user: 'admin',
        password: 'admin',
        port: 5432,
        database: 'postgres',
      }),
    })
  ],
})
```

Service: 

```typescript
@Injectable()
export class TestRepository {
  constructor(private readonly postgresService: PostgresService) {}
  async getById(id: string) {
    const sql = 'SELECT * FROM test WHERE id = $1';
    
    return this.postgresService.query(sql, [id]);
  }
}
```

`PostgresService.query`: 

```typescript
await PostgresService.query(
      'INSERT INTO test(id) VALUES($1);',
      [test.id],
    );
```

`PostgresService.transact`:

```typescript
const queries = [
  {
    sql: 'INSERT INTO test(id) VALUES($1);',
    params: [test.id],
  },
  {
    sql: 'INSERT INTO test_1(id) VALUES($1);',
    params: [test1.id],
  },
];
await this.pgService.transact(queries);
```


## Change Log

See [Changelog](CHANGELOG.md) for more information.

## Author

[**papakapa**](https://github.com/papakapa)

## License

Licensed under the MIT License - see the [LICENSE](LICENSE) file for details.