open-index/open-npm huggingface dataset:
npm package: @naplaca/eslint-config
Description: NaPlaca base eslint config
Author: Natael Bernardo
Latest version: 1.0.0

# @naplaca/eslint-config

<br />

<div align="center">
  <h3>Base ESlint configuration</h3>
  <p>NaPlaca eslint configuration for applications and packages.</p>
</div>

<br />

<div align="center">

[![npm-image]][npm-url] [![license-image]][license-url]

</div>

## Installation

Install the package from the npm registry.

```sh
npm i -D @naplaca/eslint-config

# Install peer dependencies
npm i -D eslint prettier
```

## Usage

After installation, use one of the following presets depending on the nature of your application/library.

**For package development**: Use the following preset when developing a package

```ts
// eslint.config.js
import { baseConfig } from "@naplaca/eslint-config";
export default baseConfig({});
```

**For nextjs app development**: Use the following preset when developing a nextjs application

```ts
// eslint.config.js
import { configNextApp } from "@naplaca/eslint-config";
export default configNextApp(...yourConfig);
```

[npm-image]: https://img.shields.io/npm/v/@naplaca/eslint-config/latest.svg?style=for-the-badge&logo=npm
[npm-url]: https://www.npmjs.com/package/@naplaca/eslint-config/v/latest "npm"
[license-url]: LICENSE.md
[license-image]: https://img.shields.io/github/license/naplaca/devkit?style=for-the-badge
npm package: @naplaca/prettier-config
Description: Prettier configuration for applications and packages
Author: Natael Bernardo
Latest version: 1.0.1

# @naplaca/prettier-config

<br />

<div align="center">
  <h3>Base Prettier configuration</h3>
  <p>NaPlaca prettier configuration for applications and packages.</p>
</div>

<br />

<div align="center">

[![npm-image]][npm-url] [![license-image]][license-url]

</div>

## Installation

Install the package from the npm registry.

```sh
npm i -D @naplaca/prettier-config

# Make sure also to install the following packages
npm i -D prettier
```

## Usage

After installation, you can copy/paste the following block of code within the `package.json` file.

```json
{
  "prettier": "@naplaca/prettier-config"
}
```

[npm-image]: https://img.shields.io/npm/v/@naplaca/prettier-config/latest.svg?style=for-the-badge&logo=npm
[npm-url]: https://www.npmjs.com/package/@naplaca/prettier-config/v/latest "npm"
[license-url]: LICENSE.md
[license-image]: https://img.shields.io/github/license/naplaca/devkit?style=for-the-badge
npm package: @naplink/napgram-gateway-client
Description: NapGram Gateway Node.js WebSocket client.
Latest version: 0.0.1

# @naplink/napgram-gateway-client

NapGram Gateway 的 Node.js 客户端（WebSocket）。

该包实现了与 NapGram Gateway 的连接、认证、心跳、RPC 调用，并复用 `@naplink/napgram-gateway-protocol` 的类型。

## 安装

```bash
pnpm add @naplink/napgram-gateway-client
```

## 快速开始

```ts
import { NapGramGatewayClient } from '@naplink/napgram-gateway-client';

const client = new NapGramGatewayClient({
  endpoint: 'ws://127.0.0.1:8765/',
  token: process.env.ADMIN_TOKEN!,
  instances: [0],
});

client.on('ready', (ready) => {
  console.log('ready:', ready.user);
});

client.on('message.created', async (event) => {
  const text = event.message.segments
    .filter(s => s.type === 'text')
    .map(s => String(s.data?.text ?? ''))
    .join('');

  if (text.trim() === 'ping') {
    await client.sendMessage({
      instanceId: event.instanceId,
      channelId: event.channelId,
      segments: [{ type: 'text', data: { text: 'pong' } }],
    });
  }
});

await client.connect();
```
npm package: @naplink/napgram-gateway-protocol
Description: NapGram Gateway protocol types (frames/events/actions).
Latest version: 0.0.1

# @naplink/napgram-gateway-protocol

NapGram Gateway 的协议契约（TypeScript types）。

该包仅包含协议结构定义：frames / events / actions，可被服务端、插件、工具链共同复用。

## 安装

```bash
pnpm add @naplink/napgram-gateway-protocol
```

## 用法

```ts
import type { Frame, MessageCreatedEvent, Segment } from '@naplink/napgram-gateway-protocol';
import { extractPlainText, makeAt, makeReply, makeText } from '@naplink/napgram-gateway-protocol';
```

## 包含内容

- `frames`：`hello/identify/ready/ping/pong/event/call/result/error`
- `events`：`message.created`（MVP）
- `actions`：`message.send`（MVP）
- `segments`：常用 segment 构造与文本提取
- `errors`：错误码与错误结构
npm package: @naplink/napgram-gateway-sdk
Description: NapGram Gateway SDK (client + protocol).
Latest version: 0.0.1

# @naplink/napgram-gateway-sdk

NapGram Gateway 的聚合 SDK 包。

面向插件作者的默认入口：安装一个包即可获得 client + protocol 的全部导出。

## 安装

```bash
pnpm add @naplink/napgram-gateway-sdk
```

## 用法

```ts
import { NapGramGatewayClient } from '@naplink/napgram-gateway-sdk';
import type { MessageCreatedEvent, Segment } from '@naplink/napgram-gateway-sdk';
```

## 依赖关系

- `@naplink/napgram-gateway-client`
- `@naplink/napgram-gateway-protocol`
npm package: @naplink/naplink
Description: 现代化的 NapCat WebSocket TypeScript/JavaScript 客户端 SDK
Latest version: 0.0.10

# NapLink

> 现代化的 NapCat WebSocket TypeScript/JavaScript 客户端 SDK

[![npm](https://img.shields.io/npm/v/@naplink/naplink?logo=npm)](https://www.npmjs.com/package/@naplink/naplink)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.4+-blue)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node.js-18+-green)](https://nodejs.org/)
[![Documentation](https://img.shields.io/badge/docs-naplink.github.io-blue)](https://naplink.github.io/)
[![License](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)

## ✨ 特性

- 🚀 **现代化设计** - TypeScript + ES2022，完整类型定义
- 🔄 **智能重连** - 指数退避重连机制，自动故障恢复
- ⏱️ **超时控制** - API 调用和连接超时保护
- 🎯 **事件驱动** - 完整的 OneBot 11 事件支持
- 📊 **完善日志** - 分级日志系统，支持自定义 logger
- 💪 **稳定可靠** - 自动心跳检测，轻量运行时依赖

## 📚 文档

完整文档请访问：**[https://naplink.github.io/](https://naplink.github.io/)**

- [快速开始](https://naplink.github.io/guide/getting-started) - 5分钟上手
- [API 文档](https://naplink.github.io/api/naplink) - 完整 API 参考
- [配置选项](https://naplink.github.io/guide/configuration) - 详细配置说明
- [事件处理](https://naplink.github.io/guide/events) - 事件系统详解
- [最佳实践](https://naplink.github.io/guide/best-practices) - 生产环境建议
- [架构设计](https://naplink.github.io/guide/architecture) - 内部实现
- 最佳实践项目：[NapGram](https://github.com/NapGram/NapGram) - 基于 NapLink 的 QQ ↔ Telegram 消息桥接

## 📦 安装

```bash
pnpm add @naplink/naplink
npm install @naplink/naplink
yarn add @naplink/naplink
```

## 🔧 配置示例

```typescript
const client = new NapLink({
  connection: {
    url: 'ws://localhost:3001',
    timeout: 30000,        // 连接超时
    pingInterval: 30000,   // 心跳间隔
  },
  reconnect: {
    enabled: true,         // 启用自动重连
    maxAttempts: 10,       // 最大重连次数
  },
  logging: {
    level: 'info',         // 日志级别
  },
  api: {
    timeout: 30000,        // API 超时
    retries: 3,            // 重试次数
  },
});
```

更多配置选项请查看 [配置文档](https://naplink.github.io/guide/configuration)。

## 🏗️ 开发

```bash
# 安装依赖
pnpm install

# 开发模式
pnpm dev

# 构建
pnpm build

# 测试
pnpm test

# 类型检查
pnpm typecheck
```

## 📄 许可证

[MIT](./LICENSE)

## 🙏 致谢

- [NapCat](https://napneko.github.io/) - 优秀的 QQ Bot 框架
- [OneBot 11](https://github.com/botuniverse/onebot-11) - 标准化 Bot 协议
- [node-napcat-ts](https://github.com/HkTeamX/node-napcat-ts) - 灵感来源

**NapLink** - 让 NapCat 开发更简单 ✨