This is an automated email from the ASF dual-hosted git repository. CritasWang pushed a commit to branch rename-package-scope in repository https://gitbox.apache.org/repos/asf/iotdb-client-nodejs.git
commit 79c8420ed3f61d9608dc51b80ada99d7defa7c37 Author: CritasWang <[email protected]> AuthorDate: Wed May 6 11:27:43 2026 +0800 rename: change package name to @iotdb/client The old name `iotdb-client-nodejs` was already taken on npm. Use scoped package `@iotdb/client` under the @iotdb org instead. --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 50 ++++++++++++++++++++++---------------------- README_zh.md | 30 +++++++++++++------------- docs/COLUMNCATEGORY_USAGE.md | 2 +- docs/data-types.md | 2 +- docs/performance-guide.md | 8 +++---- docs/redirection-design.md | 4 ++-- docs/sessiondataset-guide.md | 2 +- docs/user-guide-table-zh.md | 18 ++++++++-------- docs/user-guide-table.md | 18 ++++++++-------- docs/user-guide-tree-zh.md | 18 ++++++++-------- docs/user-guide-tree.md | 18 ++++++++-------- package-lock.json | 4 ++-- package.json | 5 ++++- 15 files changed, 94 insertions(+), 91 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da01aa1..3fa7c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,4 +51,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Example code for common use cases - Apache License 2.0 -[0.1.0]: https://github.com/CritasWang/iotdb-client-nodejs/releases/tag/v0.1.0 +[0.1.0]: https://github.com/CritasWang/@iotdb/client/releases/tag/v0.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 27dcca2..dfe9ecf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,8 +15,8 @@ Thank you for your interest in contributing to the Apache IoTDB Node.js client! 1. Clone the repository: ```bash -git clone https://github.com/CritasWang/iotdb-client-nodejs.git -cd iotdb-client-nodejs +git clone https://github.com/CritasWang/@iotdb/client.git +cd @iotdb/client ``` 2. Install dependencies: diff --git a/README.md b/README.md index 8f6a36d..bf3621b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Apache IoTDB Node.js Client [](https://www.apache.org/licenses/LICENSE-2.0.html) -[](https://www.npmjs.com/package/iotdb-client-nodejs) -[](https://nodejs.org/) +[](https://www.npmjs.com/package/@iotdb/client) +[](https://nodejs.org/) A Node.js client for Apache IoTDB with support for SessionPool and TableSessionPool, providing efficient connection management and comprehensive query capabilities. @@ -45,7 +45,7 @@ The Apache IoTDB Node.js Client is a high-performance, feature-rich client libra ## Installation ```bash -npm install iotdb-client-nodejs +npm install @iotdb/client ``` ## Requirements @@ -58,7 +58,7 @@ npm install iotdb-client-nodejs ### Basic Session Usage ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; const session = new Session({ host: 'localhost', @@ -110,7 +110,7 @@ await session.close(); The Builder pattern provides a more elegant and fluent API for configuration: ```typescript -import { Session, ConfigBuilder } from 'iotdb-client-nodejs'; +import { Session, ConfigBuilder } from '@iotdb/client'; // Build a session configuration const session = new Session( @@ -134,7 +134,7 @@ await session.close(); The `executeQueryStatement()` method returns a SessionDataSet for efficient iteration through query results: ```typescript -import { Session, SessionDataSet, RowRecord } from 'iotdb-client-nodejs'; +import { Session, SessionDataSet, RowRecord } from '@iotdb/client'; const session = new Session({ host: 'localhost', @@ -182,7 +182,7 @@ See [SessionDataSet Guide](docs/sessiondataset-guide.md) for complete documentat ### SessionPool Usage ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; const pool = new SessionPool('localhost', 6667, { username: 'root', @@ -263,7 +263,7 @@ await pool.close(); For more control, you can explicitly get and release sessions from the pool: ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; const pool = new SessionPool('localhost', 6667, { username: 'root', @@ -304,7 +304,7 @@ For high-throughput scenarios, use the concurrent APIs optimized for Node.js: Insert multiple tablets in a single RPC call (most efficient for tree model): ```typescript -import { Session, TreeTablet, TSDataType } from 'iotdb-client-nodejs'; +import { Session, TreeTablet, TSDataType } from '@iotdb/client'; const session = new Session({ host: 'localhost', port: 6667 }); await session.open(); @@ -332,7 +332,7 @@ await session.close(); Use pool-level concurrent insertion for maximum throughput: ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; const pool = new SessionPool({ host: 'localhost', @@ -357,7 +357,7 @@ await pool.close(); Execute any operations in parallel using the pool: ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; const pool = new SessionPool({ host: 'localhost', port: 6667, maxPoolSize: 10 }); await pool.init(); @@ -386,7 +386,7 @@ await pool.close(); Standalone utilities for concurrent execution: ```typescript -import { executeConcurrent, chunkArray, createSemaphore } from 'iotdb-client-nodejs'; +import { executeConcurrent, chunkArray, createSemaphore } from '@iotdb/client'; // Execute any async operations with controlled concurrency const result = await executeConcurrent( @@ -416,7 +416,7 @@ try { When nodes have different host:port combinations, use the `nodeUrls` configuration with string array format: ```typescript -import { SessionPool, PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { SessionPool, PoolConfigBuilder } from '@iotdb/client'; // Using config object with string array (RECOMMENDED) const pool1 = new SessionPool({ @@ -472,7 +472,7 @@ const pool = new SessionPool({ When all nodes share the same port: ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; const pool = new SessionPool( ['node1.example.com', 'node2.example.com', 'node3.example.com'], @@ -491,7 +491,7 @@ await pool.init(); ### SSL/TLS Support ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; import * as fs from 'fs'; const session = new Session({ @@ -514,7 +514,7 @@ await session.open(); ### TableSessionPool Usage ```typescript -import { TableSessionPool } from 'iotdb-client-nodejs'; +import { TableSessionPool } from '@iotdb/client'; const tablePool = new TableSessionPool('localhost', 6667, { username: 'root', @@ -551,7 +551,7 @@ The client now supports automatic write redirection for multi-node IoTDB cluster **Configuration:** ```typescript -import { SessionPool, TableSessionPool } from 'iotdb-client-nodejs'; +import { SessionPool, TableSessionPool } from '@iotdb/client'; // Tree model pool with redirection const treePool = new SessionPool({ @@ -626,7 +626,7 @@ See [docs/redirection-design.md](docs/redirection-design.md) for detailed design Fluent API for building Session configurations: ```typescript -import { ConfigBuilder } from 'iotdb-client-nodejs'; +import { ConfigBuilder } from '@iotdb/client'; const config = new ConfigBuilder() .host('localhost') @@ -658,7 +658,7 @@ const config = new ConfigBuilder() Fluent API for building SessionPool configurations (extends ConfigBuilder): ```typescript -import { PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { PoolConfigBuilder } from '@iotdb/client'; const config = new PoolConfigBuilder() .host('localhost') @@ -817,7 +817,7 @@ interface ITreeTablet { **Class (with helper methods):** ```typescript -import { TreeTablet, TSDataType } from 'iotdb-client-nodejs'; +import { TreeTablet, TSDataType } from '@iotdb/client'; // Create a tablet const tablet = new TreeTablet( @@ -869,7 +869,7 @@ enum ColumnCategory { **Class (with helper methods):** ```typescript -import { TableTablet, ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { TableTablet, ColumnCategory, TSDataType } from '@iotdb/client'; // Create a tablet const tablet = new TableTablet( @@ -994,7 +994,7 @@ const session = new Session({ **New way** (more fluent): ```typescript -import { ConfigBuilder } from 'iotdb-client-nodejs'; +import { ConfigBuilder } from '@iotdb/client'; const session = new Session( new ConfigBuilder() @@ -1221,8 +1221,8 @@ const session = new Session( 1. Clone the repository: ```bash -git clone https://github.com/CritasWang/iotdb-client-nodejs.git -cd iotdb-client-nodejs +git clone https://github.com/CritasWang/@iotdb/client.git +cd @iotdb/client ``` 2. Install dependencies: @@ -1750,7 +1750,7 @@ npm version 1.2.0-beta.1 --no-git-tag-version npm publish --tag beta # Install beta version -npm install iotdb-client-nodejs@beta +npm install @iotdb/client@beta ``` ### Hotfix Process diff --git a/README_zh.md b/README_zh.md index 1b2cd64..be04a96 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,8 +1,8 @@ # Apache IoTDB Node.js 客户端 [](https://www.apache.org/licenses/LICENSE-2.0.html) -[](https://www.npmjs.com/package/iotdb-client-nodejs) -[](https://nodejs.org/) +[](https://www.npmjs.com/package/@iotdb/client) +[](https://nodejs.org/) 用于 Apache IoTDB 的 Node.js 客户端,支持 SessionPool 和 TableSessionPool,提供高效的连接管理和全面的查询功能。 @@ -43,7 +43,7 @@ Apache IoTDB Node.js 客户端是一个高性能、功能丰富的客户端库 ## 安装 ```bash -npm install iotdb-client-nodejs +npm install @iotdb/client ``` ## 环境要求 @@ -56,7 +56,7 @@ npm install iotdb-client-nodejs ### 基本会话使用 ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; const session = new Session({ host: 'localhost', @@ -103,7 +103,7 @@ await session.close(); 构建器模式提供更优雅和流畅的配置 API: ```typescript -import { Session, ConfigBuilder } from 'iotdb-client-nodejs'; +import { Session, ConfigBuilder } from '@iotdb/client'; // 构建会话配置 const session = new Session( @@ -125,7 +125,7 @@ await session.close(); ### SessionPool 使用 ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; const pool = new SessionPool('localhost', 6667, { username: 'root', @@ -169,7 +169,7 @@ await pool.close(); 当节点具有不同的 host:port 组合时,使用字符串数组格式的 `nodeUrls` 配置: ```typescript -import { SessionPool, PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { SessionPool, PoolConfigBuilder } from '@iotdb/client'; // 使用字符串数组的配置对象(推荐) const pool1 = new SessionPool({ @@ -206,7 +206,7 @@ await pool1.init(); ### SSL/TLS 支持 ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; import * as fs from 'fs'; const session = new Session({ @@ -229,7 +229,7 @@ await session.open(); ### TableSessionPool 使用 ```typescript -import { TableSessionPool } from 'iotdb-client-nodejs'; +import { TableSessionPool } from '@iotdb/client'; const tablePool = new TableSessionPool('localhost', 6667, { username: 'root', @@ -396,7 +396,7 @@ IoTDB Node.js 客户端采用三层架构设计,针对单会话和高并发场 **配置:** ```typescript -import { SessionPool, TableSessionPool } from 'iotdb-client-nodejs'; +import { SessionPool, TableSessionPool } from '@iotdb/client'; // 带重定向的树模型连接池 const treePool = new SessionPool({ @@ -471,7 +471,7 @@ MULTI_NODE=true npm run test:e2e 用于构建 Session 配置的流式 API: ```typescript -import { ConfigBuilder } from 'iotdb-client-nodejs'; +import { ConfigBuilder } from '@iotdb/client'; const config = new ConfigBuilder() .host('localhost') @@ -503,7 +503,7 @@ const config = new ConfigBuilder() 用于构建 SessionPool 配置的流式 API(扩展 ConfigBuilder): ```typescript -import { PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { PoolConfigBuilder } from '@iotdb/client'; const config = new PoolConfigBuilder() .host('localhost') @@ -623,8 +623,8 @@ new SessionPool(new PoolConfigBuilder()...build()) 1. 克隆仓库: ```bash -git clone https://github.com/CritasWang/iotdb-client-nodejs.git -cd iotdb-client-nodejs +git clone https://github.com/CritasWang/@iotdb/client.git +cd @iotdb/client ``` 2. 安装依赖: @@ -1140,7 +1140,7 @@ npm version 1.2.0-beta.1 --no-git-tag-version npm publish --tag beta # 安装 beta 版本 -npm install iotdb-client-nodejs@beta +npm install @iotdb/client@beta ``` ### 热修复流程 diff --git a/docs/COLUMNCATEGORY_USAGE.md b/docs/COLUMNCATEGORY_USAGE.md index f1904c1..c58b509 100644 --- a/docs/COLUMNCATEGORY_USAGE.md +++ b/docs/COLUMNCATEGORY_USAGE.md @@ -34,7 +34,7 @@ The `TIME` category exists to match the Java and C# client implementations. Howe ## Correct Usage Example ```typescript -import { TableSessionPool, ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { TableSessionPool, ColumnCategory, TSDataType } from '@iotdb/client'; await pool.insertTablet({ tableName: 'sensor_data', diff --git a/docs/data-types.md b/docs/data-types.md index 60c08b6..55d08f3 100644 --- a/docs/data-types.md +++ b/docs/data-types.md @@ -35,7 +35,7 @@ Type definitions are based on: ### Creating Timeseries ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; const session = new Session({ host: 'localhost', diff --git a/docs/performance-guide.md b/docs/performance-guide.md index 476ec51..bf00198 100644 --- a/docs/performance-guide.md +++ b/docs/performance-guide.md @@ -56,7 +56,7 @@ node benchmark/benchmark-table-cluster.js **Solution**: Implemented `BufferPool` with size-based pooling strategy: ```typescript -import { globalBufferPool } from 'iotdb-client-nodejs'; +import { globalBufferPool } from '@iotdb/client'; // Buffer pool automatically manages buffers in 7 size classes: // 1KB, 4KB, 16KB, 64KB, 256KB, 1MB, 4MB @@ -178,7 +178,7 @@ const avgTemp = columnar.values[0].reduce((a, b) => a + b) / columnar.values[0]. ### Enabling/Disabling Fast Serialization ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; // Enable (default) const session = new Session({ @@ -285,7 +285,7 @@ await largeDataSet.close(); ### 4. Monitor Buffer Pool Usage ```typescript -import { globalBufferPool } from 'iotdb-client-nodejs'; +import { globalBufferPool } from '@iotdb/client'; // After warmup period setInterval(() => { @@ -319,7 +319,7 @@ setInterval(() => { ```typescript // Clear buffer pool periodically in long-running processes -import { globalBufferPool } from 'iotdb-client-nodejs'; +import { globalBufferPool } from '@iotdb/client'; // Clear pool every hour to prevent potential memory bloat setInterval(() => { diff --git a/docs/redirection-design.md b/docs/redirection-design.md index f61f0c9..f309a78 100644 --- a/docs/redirection-design.md +++ b/docs/redirection-design.md @@ -443,8 +443,8 @@ docker-compose -f docker-compose-1c3d.yml down ## Usage Example ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; -import { TSDataType } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; +import { TSDataType } from '@iotdb/client'; // Create pool with redirection enabled const pool = new SessionPool({ diff --git a/docs/sessiondataset-guide.md b/docs/sessiondataset-guide.md index abe8012..ce1e826 100644 --- a/docs/sessiondataset-guide.md +++ b/docs/sessiondataset-guide.md @@ -16,7 +16,7 @@ The SessionDataSet provides an iterator-based approach to reading query results, ### Simple Iteration ```typescript -import { Session } from 'iotdb-client-nodejs'; +import { Session } from '@iotdb/client'; const session = new Session({ host: 'localhost', diff --git a/docs/user-guide-table-zh.md b/docs/user-guide-table-zh.md index 6e475f7..575ce8b 100644 --- a/docs/user-guide-table-zh.md +++ b/docs/user-guide-table-zh.md @@ -54,7 +54,7 @@ IoTDB 中的表模型采用关系格式组织数据: ### 2.1 从 npm 安装 ```bash -npm install iotdb-client-nodejs +npm install @iotdb/client ``` **系统要求:** @@ -65,12 +65,12 @@ npm install iotdb-client-nodejs **TypeScript:** ```typescript -import { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } from '@iotdb/client'; ``` **JavaScript:** ```javascript -const { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } = require('iotdb-client-nodejs'); +const { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } = require('@iotdb/client'); ``` ## 3. 快速入门 @@ -78,7 +78,7 @@ const { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSData ### 3.1 基础 TableSessionPool 示例 ```typescript -import { TableSessionPool, TableTablet, ColumnCategory } from 'iotdb-client-nodejs'; +import { TableSessionPool, TableTablet, ColumnCategory } from '@iotdb/client'; async function quickStart() { // 创建并初始化表 session 连接池 @@ -224,7 +224,7 @@ const pool = new TableSessionPool({ #### 方式 3: 使用构建器模式(推荐) ```typescript -import { PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { PoolConfigBuilder } from '@iotdb/client'; const pool = new TableSessionPool( new PoolConfigBuilder() @@ -378,7 +378,7 @@ enum ColumnCategory { **TableTablet 类 (带辅助方法 - 推荐):** ```typescript -import { TableTablet, ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { TableTablet, ColumnCategory, TSDataType } from '@iotdb/client'; // 创建 tablet const tablet = new TableTablet( @@ -399,7 +399,7 @@ await pool.insertTablet(tablet); **替代方案: 普通对象方法 (仍支持):** ```typescript -import { ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { ColumnCategory, TSDataType } from '@iotdb/client'; await pool.insertTablet({ tableName: 'sensor_data', @@ -548,7 +548,7 @@ await pool.insertTablet({ ### 7.1 完整的数据库和表设置 ```typescript -import { TableSessionPool, PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { TableSessionPool, PoolConfigBuilder } from '@iotdb/client'; async function setupDatabase() { const pool = new TableSessionPool( @@ -1022,7 +1022,7 @@ console.log(`Returned ${rowCount} rows`); ### 9.4 获取帮助 - **文档**: [IoTDB Table Model Docs](https://iotdb.apache.org/) -- **GitHub Issues**: [报告问题](https://github.com/CritasWang/iotdb-client-nodejs/issues) +- **GitHub Issues**: [报告问题](https://github.com/CritasWang/@iotdb/client/issues) - **社区**: [email protected] ## 附录 A: 完整 API 参考 diff --git a/docs/user-guide-table.md b/docs/user-guide-table.md index d056bf5..107e8a6 100644 --- a/docs/user-guide-table.md +++ b/docs/user-guide-table.md @@ -54,7 +54,7 @@ The table model in IoTDB organizes data in a relational format: ### 2.1 Install from npm ```bash -npm install iotdb-client-nodejs +npm install @iotdb/client ``` **Requirements:** @@ -65,12 +65,12 @@ npm install iotdb-client-nodejs **TypeScript:** ```typescript -import { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } from '@iotdb/client'; ``` **JavaScript:** ```javascript -const { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } = require('iotdb-client-nodejs'); +const { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSDataType } = require('@iotdb/client'); ``` ## 3. Quick Start @@ -78,7 +78,7 @@ const { TableSessionPool, PoolConfigBuilder, TableTablet, ColumnCategory, TSData ### 3.1 Basic TableSessionPool Example ```typescript -import { TableSessionPool, TableTablet, ColumnCategory } from 'iotdb-client-nodejs'; +import { TableSessionPool, TableTablet, ColumnCategory } from '@iotdb/client'; async function quickStart() { // Create and initialize table session pool @@ -224,7 +224,7 @@ const pool = new TableSessionPool({ #### Option 3: Using Builder Pattern (Recommended) ```typescript -import { PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { PoolConfigBuilder } from '@iotdb/client'; const pool = new TableSessionPool( new PoolConfigBuilder() @@ -378,7 +378,7 @@ enum ColumnCategory { **TableTablet Class (with helper methods - recommended):** ```typescript -import { TableTablet, ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { TableTablet, ColumnCategory, TSDataType } from '@iotdb/client'; // Create a tablet const tablet = new TableTablet( @@ -399,7 +399,7 @@ await pool.insertTablet(tablet); **Alternative: Plain object approach (still supported):** ```typescript -import { ColumnCategory, TSDataType } from 'iotdb-client-nodejs'; +import { ColumnCategory, TSDataType } from '@iotdb/client'; await pool.insertTablet({ tableName: 'sensor_data', @@ -548,7 +548,7 @@ await pool.insertTablet({ ### 7.1 Complete Database and Table Setup ```typescript -import { TableSessionPool, PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { TableSessionPool, PoolConfigBuilder } from '@iotdb/client'; async function setupDatabase() { const pool = new TableSessionPool( @@ -1022,7 +1022,7 @@ console.log(`Returned ${rowCount} rows`); ### 9.4 Getting Help - **Documentation**: [IoTDB Table Model Docs](https://iotdb.apache.org/) -- **GitHub Issues**: [Report bugs](https://github.com/CritasWang/iotdb-client-nodejs/issues) +- **GitHub Issues**: [Report bugs](https://github.com/CritasWang/@iotdb/client/issues) - **Community**: [email protected] ## Appendix A: Complete API Reference diff --git a/docs/user-guide-tree-zh.md b/docs/user-guide-tree-zh.md index af08763..3b67d93 100644 --- a/docs/user-guide-tree-zh.md +++ b/docs/user-guide-tree-zh.md @@ -43,7 +43,7 @@ IoTDB 中的树模型采用分层组织数据: ### 2.1 从 npm 安装 ```bash -npm install iotdb-client-nodejs +npm install @iotdb/client ``` **系统要求:** @@ -54,12 +54,12 @@ npm install iotdb-client-nodejs **TypeScript:** ```typescript -import { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } from 'iotdb-client-nodejs'; +import { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } from '@iotdb/client'; ``` **JavaScript:** ```javascript -const { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } = require('iotdb-client-nodejs'); +const { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } = require('@iotdb/client'); ``` ## 3. 快速入门 @@ -67,7 +67,7 @@ const { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } = require('iotd ### 3.1 SessionPool 示例 ```typescript -import { SessionPool, TreeTablet } from 'iotdb-client-nodejs'; +import { SessionPool, TreeTablet } from '@iotdb/client'; async function quickStart() { // 创建并初始化连接池 @@ -164,7 +164,7 @@ const pool = new SessionPool({ #### 方式 3: 使用构建器模式(推荐) ```typescript -import { PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { PoolConfigBuilder } from '@iotdb/client'; const pool = new SessionPool( new PoolConfigBuilder() @@ -392,7 +392,7 @@ await pool.insertTablet({ ### 7.1 完整的 CRUD 示例 ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; async function crudExample() { const pool = new SessionPool('localhost', 6667, { @@ -446,7 +446,7 @@ crudExample(); ### 7.2 多节点 SessionPool 示例 ```typescript -import { SessionPool, PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { SessionPool, PoolConfigBuilder } from '@iotdb/client'; async function multiNodeExample() { const pool = new SessionPool( @@ -674,7 +674,7 @@ FATAL ERROR: Reached heap limit process.env.LOG_LEVEL = 'debug'; // 或直接使用 logger -import { logger } from 'iotdb-client-nodejs'; +import { logger } from '@iotdb/client'; logger.setLevel('debug'); ``` @@ -703,7 +703,7 @@ console.log(`Query took ${Date.now() - start}ms`); ### 9.4 获取帮助 - **文档**: [IoTDB Docs](https://iotdb.apache.org/) -- **GitHub Issues**: [报告问题](https://github.com/CritasWang/iotdb-client-nodejs/issues) +- **GitHub Issues**: [报告问题](https://github.com/CritasWang/@iotdb/client/issues) - **邮件列表**: [email protected] ## 附录 A: 完整类型参考 diff --git a/docs/user-guide-tree.md b/docs/user-guide-tree.md index 8d87a85..10173a0 100644 --- a/docs/user-guide-tree.md +++ b/docs/user-guide-tree.md @@ -43,7 +43,7 @@ The tree model in IoTDB organizes data hierarchically: ### 2.1 Install from npm ```bash -npm install iotdb-client-nodejs +npm install @iotdb/client ``` **Requirements:** @@ -54,12 +54,12 @@ npm install iotdb-client-nodejs **TypeScript:** ```typescript -import { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } from 'iotdb-client-nodejs'; +import { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } from '@iotdb/client'; ``` **JavaScript:** ```javascript -const { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } = require('iotdb-client-nodejs'); +const { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } = require('@iotdb/client'); ``` ## 3. Quick Start @@ -67,7 +67,7 @@ const { SessionPool, PoolConfigBuilder, TreeTablet, TSDataType } = require('iotd ### 3.1 SessionPool Example ```typescript -import { SessionPool, TreeTablet } from 'iotdb-client-nodejs'; +import { SessionPool, TreeTablet } from '@iotdb/client'; async function quickStart() { // Create and initialize pool @@ -164,7 +164,7 @@ const pool = new SessionPool({ #### Option 3: Using Builder Pattern (Recommended) ```typescript -import { PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { PoolConfigBuilder } from '@iotdb/client'; const pool = new SessionPool( new PoolConfigBuilder() @@ -392,7 +392,7 @@ await pool.insertTablet({ ### 7.1 Complete CRUD Example ```typescript -import { SessionPool } from 'iotdb-client-nodejs'; +import { SessionPool } from '@iotdb/client'; async function crudExample() { const pool = new SessionPool('localhost', 6667, { @@ -446,7 +446,7 @@ crudExample(); ### 7.2 Multi-Node SessionPool Example ```typescript -import { SessionPool, PoolConfigBuilder } from 'iotdb-client-nodejs'; +import { SessionPool, PoolConfigBuilder } from '@iotdb/client'; async function multiNodeExample() { const pool = new SessionPool( @@ -674,7 +674,7 @@ FATAL ERROR: Reached heap limit process.env.LOG_LEVEL = 'debug'; // Or use logger directly -import { logger } from 'iotdb-client-nodejs'; +import { logger } from '@iotdb/client'; logger.setLevel('debug'); ``` @@ -703,7 +703,7 @@ console.log(`Query took ${Date.now() - start}ms`); ### 9.4 Getting Help - **Documentation**: [IoTDB Docs](https://iotdb.apache.org/) -- **GitHub Issues**: [Report bugs](https://github.com/CritasWang/iotdb-client-nodejs/issues) +- **GitHub Issues**: [Report bugs](https://github.com/CritasWang/@iotdb/client/issues) - **Mailing List**: [email protected] ## Appendix A: Complete Type Reference diff --git a/package-lock.json b/package-lock.json index 70a4e5e..8cd6eb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "iotdb-client-nodejs", + "name": "@iotdb/client", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "iotdb-client-nodejs", + "name": "@iotdb/client", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index a9ec0d4..efa45b8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { - "name": "iotdb-client-nodejs", + "name": "@iotdb/client", + "publishConfig": { + "access": "public" + }, "version": "0.1.0", "description": "Apache IoTDB Node.js client with SessionPool and TableSessionPool support", "main": "dist/index.js",
