{"_id":"@dangao/nacos-client","_rev":"3-1f3f91fa9eaf5174aa80948b05944f7e","name":"@dangao/nacos-client","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@dangao/nacos-client","version":"0.1.0","keywords":["nacos","config-center","service-discovery","microservice","bun"],"author":"dangaogit","license":"MIT","_id":"@dangao/nacos-client@0.1.0","maintainers":[{"name":"dangao","email":"dangaogm@gmail.com"}],"dist":{"shasum":"9fff7c7a5d0721395e3627f4e1bbfabca69ac961","tarball":"https://registry.npmjs.org/@dangao/nacos-client/-/nacos-client-0.1.0.tgz","fileCount":12,"integrity":"sha512-2v9HnesrKtBw1Ltq9cCAevqQhD6oMOK6T4FI8Smf5bQSmz1z55ukuuSwW+PaXCkiWTN2yvH23jcX+cMVrZtGbA==","signatures":[{"sig":"MEQCIGcoKhDBxIVf/UuQ58eHzq8JoTH1GmOTrk/BIGTZXmM6AiBG+3Z7fC0qRjkIXqvHvVllIJEa5aHkePejN68F8FcjBA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19882},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"9fff7c7a5d0721395e3627f4e1bbfabca69ac961","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dts":"tsc -p tsconfig.build.json","build":"bun run clean && bun run bundle && bun run dts","clean":"rm -rf dist","bundle":"bun build src/index.ts --target=bun --format=esm --outfile=dist/index.js"},"_npmUser":{"name":"dangao","email":"dangaogm@gmail.com"},"_integrity":"sha512-2v9HnesrKtBw1Ltq9cCAevqQhD6oMOK6T4FI8Smf5bQSmz1z55ukuuSwW+PaXCkiWTN2yvH23jcX+cMVrZtGbA==","repository":{"url":"https://github.com/dangaogit/bun-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Nacos 3.X Open API client for Bun runtime","directories":{},"_nodeVersion":"24.3.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/nacos-client_0.1.0_1765849616092_0.766204192145862","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dangao/nacos-client","version":"0.1.1","keywords":["nacos","config-center","service-discovery","microservice","bun"],"author":"dangaogit","license":"MIT","_id":"@dangao/nacos-client@0.1.1","maintainers":[{"name":"dangao","email":"dangaogm@gmail.com"}],"dist":{"shasum":"c456cdc5fd1c114245437f5dc8b18d5011556fde","tarball":"https://registry.npmjs.org/@dangao/nacos-client/-/nacos-client-0.1.1.tgz","fileCount":14,"integrity":"sha512-6qjQ8m9++1cASkBtWCEGPXfxFBpnxYkpxQ7J1eAzXktNLin08C9xwqGe8AizEEBf912gfjci9WsKdQ2KlZfm7Q==","signatures":[{"sig":"MEQCIBxZTUt5dqxdIjvEp3xfXdiHanzH+FwHT2qQnlzgMwdAAiAMN4B2uR6vtDJtoKakS2mxZwb2OZTQdxKdVjDthhU66g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36705},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"c456cdc5fd1c114245437f5dc8b18d5011556fde","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dts":"tsc -p tsconfig.build.json","build":"bun run clean && bun run bundle && bun run dts","clean":"rm -rf dist","bundle":"bun build src/index.ts --target=bun --format=esm --outfile=dist/index.js","publish:package":"cp -r ../../LICENSE . && bun publish --access public && rm -rf ./LICENSE"},"_npmUser":{"name":"dangao","email":"dangaogm@gmail.com"},"_integrity":"sha512-6qjQ8m9++1cASkBtWCEGPXfxFBpnxYkpxQ7J1eAzXktNLin08C9xwqGe8AizEEBf912gfjci9WsKdQ2KlZfm7Q==","repository":{"url":"https://github.com/dangaogit/bun-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Nacos 3.X Open API client for Bun runtime","directories":{},"_nodeVersion":"24.3.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/nacos-client_0.1.1_1768897631820_0.9083318337289394","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dangao/nacos-client","description":"Nacos 3.X Open API client for Bun runtime","version":"0.1.2","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"author":"dangaogit","license":"MIT","repository":{"type":"git","url":"https://github.com/dangaogit/bun-server.git"},"keywords":["nacos","config-center","service-discovery","microservice","bun"],"scripts":{"test":"bun test","build":"bun run clean && bun run bundle && bun run dts","typecheck":"tsc -p tsconfig.build.json --noEmit","clean":"rm -rf dist","bundle":"bun build src/index.ts --target=bun --format=esm --outfile=dist/index.js","dts":"tsc -p tsconfig.build.json","publish:package":"cp -r ../../LICENSE . && bun publish --access public && rm -rf ./LICENSE"},"devDependencies":{"typescript":"^5.9.3"},"_id":"@dangao/nacos-client@0.1.2","_integrity":"sha512-5LKW6ku93pmW7HUY5dgWhTjL5pXpTUTMDmKS+BiFib3U4HCkKvSa7QSLFPj3/8hMJgGDIC+tSflLdxUilIDMyQ==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"bd9b144d71ff50362254eefa70f1eb89099ce346","dist":{"integrity":"sha512-5LKW6ku93pmW7HUY5dgWhTjL5pXpTUTMDmKS+BiFib3U4HCkKvSa7QSLFPj3/8hMJgGDIC+tSflLdxUilIDMyQ==","shasum":"bd9b144d71ff50362254eefa70f1eb89099ce346","tarball":"https://registry.npmjs.org/@dangao/nacos-client/-/nacos-client-0.1.2.tgz","fileCount":14,"unpackedSize":37642,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGvCPPteOnKG/PVNkXAauwC491hGuoCLAv0xv3Ng7VGrAiEApHncitvXiA8y9Xrq3ujhy+HR3O+5bY6S8LwMdG6YIdw="}]},"_npmUser":{"name":"dangao","email":"dangaogm@gmail.com"},"directories":{},"maintainers":[{"name":"dangao","email":"dangaogm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nacos-client_0.1.2_1782123678637_0.993318893397579"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-16T01:46:56.028Z","modified":"2026-06-22T10:21:18.882Z","0.1.0":"2025-12-16T01:46:56.283Z","0.1.1":"2026-01-20T08:27:11.968Z","0.1.2":"2026-06-22T10:21:18.775Z"},"author":"dangaogit","license":"MIT","keywords":["nacos","config-center","service-discovery","microservice","bun"],"repository":{"type":"git","url":"https://github.com/dangaogit/bun-server.git"},"description":"Nacos 3.X Open API client for Bun runtime","maintainers":[{"name":"dangao","email":"dangaogm@gmail.com"}],"readme":"# @dangao/nacos-client\n\nA lightweight Nacos 3.X Open API client for Bun runtime, supporting\nconfiguration management and service discovery.\n\n## Features\n\n- **Configuration Management** - Get configurations from Nacos config center\n- **Service Discovery** - Register, deregister, and query service instances\n- **High Availability** - Automatic server failover and retry mechanism\n- **TypeScript Native** - Full TypeScript support with complete type definitions\n- **Bun Optimized** - Designed specifically for Bun runtime\n\n## Installation\n\n```bash\nbun add @dangao/nacos-client\n```\n\n## Quick Start\n\n### Configuration Management\n\n```typescript\nimport { NacosClient, NacosConfigClient } from \"@dangao/nacos-client\";\n\n// Create client (omit namespaceId for the public namespace)\nconst client = new NacosClient({\n  serverList: [\"http://localhost:8848\"],\n  username: \"nacos\",\n  password: \"nacos\",\n});\n\nconst configClient = new NacosConfigClient(client);\n\n// Get configuration\nconst config = await configClient.getConfig({\n  dataId: \"application.yaml\",\n  groupName: \"DEFAULT_GROUP\",\n});\n\nconsole.log(config.content); // Configuration content\nconsole.log(config.md5); // Configuration MD5 hash\nconsole.log(config.contentType); // Content type\n```\n\n### Service Discovery\n\n```typescript\nimport { NacosClient, NacosServiceClient } from \"@dangao/nacos-client\";\n\nconst client = new NacosClient({\n  serverList: [\"http://localhost:8848\"],\n});\n\nconst serviceClient = new NacosServiceClient(client);\n\n// Register service instance\nawait serviceClient.registerInstance({\n  serviceName: \"my-service\",\n  ip: \"192.168.1.100\",\n  port: 8080,\n  weight: 1,\n  enabled: true,\n  metadata: {\n    version: \"1.0.0\",\n    env: \"production\",\n  },\n});\n\n// Query service instances\nconst instances = await serviceClient.getInstances({\n  serviceName: \"my-service\",\n  healthyOnly: true,\n});\n\nconsole.log(instances);\n\n// Deregister service instance\nawait serviceClient.deregisterInstance(\"my-service\", \"192.168.1.100\", 8080);\n```\n\n## API Reference\n\n### NacosClient\n\nThe base HTTP client that handles communication with Nacos server.\n\n#### Constructor Options\n\n| Option        | Type       | Required | Default | Description                           |\n| ------------- | ---------- | -------- | ------- | ------------------------------------- |\n| `serverList`  | `string[]` | Yes      | -       | Nacos server addresses                |\n| `namespaceId` | `string`   | No       | `\"\"`    | Namespace ID; omit for public (empty string, not the literal `\"public\"`) |\n| `username`    | `string`   | No       | -       | Username for authentication           |\n| `password`    | `string`   | No       | -       | Password for authentication           |\n| `timeout`     | `number`   | No       | `5000`  | Request timeout in milliseconds       |\n| `retryCount`  | `number`   | No       | `3`     | Number of retry attempts              |\n| `retryDelay`  | `number`   | No       | `1000`  | Delay between retries in milliseconds |\n\n### NacosConfigClient\n\nClient for configuration management operations.\n\n#### Methods\n\n##### `getConfig(options: GetConfigOptions): Promise<ConfigResult>`\n\nGet configuration from Nacos config center.\n\n**Options:**\n\n| Field         | Type     | Required | Description                             |\n| ------------- | -------- | -------- | --------------------------------------- |\n| `dataId`      | `string` | Yes      | Configuration ID                        |\n| `groupName`   | `string` | Yes      | Configuration group                     |\n| `namespaceId` | `string` | No       | Namespace ID (overrides client setting; defaults to `\"\"` when omitted) |\n\n**Returns:** `ConfigResult`\n\n| Field          | Type     | Description                 |\n| -------------- | -------- | --------------------------- |\n| `content`      | `string` | Configuration content       |\n| `md5`          | `string` | MD5 hash of the content     |\n| `lastModified` | `number` | Last modification timestamp |\n| `contentType`  | `string` | Content type                |\n\n### NacosServiceClient\n\nClient for service registration and discovery operations.\n\n#### Methods\n\n##### `registerInstance(options: RegisterInstanceOptions): Promise<void>`\n\nRegister a service instance.\n\n**Options:**\n\n| Field         | Type                     | Required | Description                         |\n| ------------- | ------------------------ | -------- | ----------------------------------- |\n| `serviceName` | `string`                 | Yes      | Service name                        |\n| `ip`          | `string`                 | Yes      | Instance IP address                 |\n| `port`        | `number`                 | Yes      | Instance port                       |\n| `weight`      | `number`                 | No       | Instance weight                     |\n| `enabled`     | `boolean`                | No       | Whether instance is enabled         |\n| `metadata`    | `Record<string, string>` | No       | Instance metadata                   |\n| `clusterName` | `string`                 | No       | Cluster name                        |\n| `namespaceId` | `string`                 | No       | Namespace ID                        |\n| `groupName`   | `string`                 | No       | Group name                          |\n| `heartBeat`   | `boolean`                | No       | Whether this is a heartbeat request |\n\n##### `deregisterInstance(serviceName, ip, port, options?): Promise<void>`\n\nDeregister a service instance.\n\n**Parameters:**\n\n| Parameter             | Type     | Required | Description         |\n| --------------------- | -------- | -------- | ------------------- |\n| `serviceName`         | `string` | Yes      | Service name        |\n| `ip`                  | `string` | Yes      | Instance IP address |\n| `port`                | `number` | Yes      | Instance port       |\n| `options.namespaceId` | `string` | No       | Namespace ID        |\n| `options.groupName`   | `string` | No       | Group name          |\n| `options.clusterName` | `string` | No       | Cluster name        |\n\n##### `getInstances(options: GetInstancesOptions): Promise<ServiceInstance[]>`\n\nQuery service instances.\n\n**Options:**\n\n| Field         | Type      | Required | Description                   |\n| ------------- | --------- | -------- | ----------------------------- |\n| `serviceName` | `string`  | Yes      | Service name                  |\n| `namespaceId` | `string`  | No       | Namespace ID                  |\n| `groupName`   | `string`  | No       | Group name                    |\n| `clusterName` | `string`  | No       | Cluster name                  |\n| `healthyOnly` | `boolean` | No       | Only return healthy instances |\n\n**Returns:** `ServiceInstance[]`\n\n| Field         | Type                     | Description       |\n| ------------- | ------------------------ | ----------------- |\n| `serviceName` | `string`                 | Service name      |\n| `ip`          | `string`                 | Instance IP       |\n| `port`        | `number`                 | Instance port     |\n| `weight`      | `number`                 | Instance weight   |\n| `healthy`     | `boolean`                | Health status     |\n| `enabled`     | `boolean`                | Enabled status    |\n| `metadata`    | `Record<string, string>` | Instance metadata |\n| `clusterName` | `string`                 | Cluster name      |\n| `namespaceId` | `string`                 | Namespace ID      |\n| `groupName`   | `string`                 | Group name        |\n\n## Error Handling\n\nThe client throws `NacosClientError` for all errors:\n\n```typescript\nimport { NacosClientError } from \"@dangao/nacos-client\";\n\ntry {\n  const config = await configClient.getConfig({\n    dataId: \"non-existent\",\n    groupName: \"DEFAULT_GROUP\",\n  });\n} catch (error) {\n  if (error instanceof NacosClientError) {\n    console.error(\"Nacos error:\", error.message);\n    console.error(\"Cause:\", error.cause);\n  }\n}\n```\n\n## High Availability\n\nThe client supports multiple Nacos servers for high availability:\n\n```typescript\nconst client = new NacosClient({\n  serverList: [\n    \"http://nacos1:8848\",\n    \"http://nacos2:8848\",\n    \"http://nacos3:8848\",\n  ],\n  retryCount: 3,\n  retryDelay: 1000,\n});\n```\n\nWhen a server is unavailable, the client automatically switches to the next\nserver in the list and retries the request.\n\n## Integration with @dangao/bun-server\n\nThis package is designed to work seamlessly with the `@dangao/bun-server`\nframework. The framework provides higher-level abstractions through\n`ConfigCenterModule` and `ServiceRegistryModule`.\n\n### Installation\n\n```bash\nbun add @dangao/bun-server\n```\n\n> Note: `@dangao/nacos-client` is included as a dependency of\n> `@dangao/bun-server`, no need to install separately.\n\n### Using ConfigCenterModule\n\n```typescript\nimport {\n  Application,\n  CONFIG_CENTER_TOKEN,\n  type ConfigCenter,\n  ConfigCenterModule,\n  Controller,\n  GET,\n  Inject,\n  Injectable,\n  Module,\n} from \"@dangao/bun-server\";\n\n@Injectable()\nclass AppService {\n  public constructor(\n    @Inject(CONFIG_CENTER_TOKEN) private readonly configCenter: ConfigCenter,\n  ) {}\n\n  public async getAppConfig(): Promise<string> {\n    const config = await this.configCenter.getConfig(\n      \"app-config\",\n      \"DEFAULT_GROUP\",\n    );\n    return config.content;\n  }\n\n  public watchConfig(): void {\n    // Watch for config changes\n    this.configCenter.watchConfig(\"app-config\", \"DEFAULT_GROUP\", (result) => {\n      console.log(\"Config changed:\", result.content);\n    });\n  }\n}\n\n@Controller(\"/api\")\nclass AppController {\n  public constructor(private readonly appService: AppService) {}\n\n  @GET(\"/config\")\n  public async getConfig() {\n    return { config: await this.appService.getAppConfig() };\n  }\n}\n\n@Module({\n  imports: [\n    ConfigCenterModule.forRoot({\n      provider: \"nacos\",\n      nacos: {\n        client: {\n          serverList: [\"http://localhost:8848\"],\n          username: \"nacos\",\n          password: \"nacos\",\n        },\n        watchInterval: 5000, // Config watch interval (ms)\n      },\n    }),\n  ],\n  controllers: [AppController],\n  providers: [AppService],\n})\nclass AppModule {}\n\nconst app = new Application();\napp.registerModule(AppModule);\napp.listen(3000);\n```\n\n### Using ServiceRegistryModule\n\n```typescript\nimport {\n  Application,\n  Controller,\n  GET,\n  Inject,\n  Injectable,\n  Module,\n  POST,\n  SERVICE_REGISTRY_TOKEN,\n  type ServiceInstance,\n  type ServiceRegistry,\n  ServiceRegistryModule,\n} from \"@dangao/bun-server\";\n\n@Injectable()\nclass DiscoveryService {\n  public constructor(\n    @Inject(SERVICE_REGISTRY_TOKEN) private readonly serviceRegistry:\n      ServiceRegistry,\n  ) {}\n\n  public async registerSelf(): Promise<void> {\n    const instance: ServiceInstance = {\n      serviceName: \"my-service\",\n      ip: \"127.0.0.1\",\n      port: 3000,\n      weight: 1,\n      healthy: true,\n      enabled: true,\n      metadata: { version: \"1.0.0\" },\n    };\n    await this.serviceRegistry.register(instance);\n  }\n\n  public async discoverService(\n    serviceName: string,\n  ): Promise<ServiceInstance[]> {\n    return await this.serviceRegistry.getInstances(serviceName);\n  }\n\n  public watchService(serviceName: string): void {\n    this.serviceRegistry.watchInstances(serviceName, (instances) => {\n      console.log(`Service ${serviceName} instances:`, instances);\n    });\n  }\n}\n\n@Controller(\"/api\")\nclass DiscoveryController {\n  public constructor(private readonly discoveryService: DiscoveryService) {}\n\n  @POST(\"/register\")\n  public async register() {\n    await this.discoveryService.registerSelf();\n    return { message: \"Service registered\" };\n  }\n\n  @GET(\"/services/:name\")\n  public async getServices(@Param(\"name\") name: string) {\n    return await this.discoveryService.discoverService(name);\n  }\n}\n\n@Module({\n  imports: [\n    ServiceRegistryModule.forRoot({\n      provider: \"nacos\",\n      nacos: {\n        client: {\n          serverList: [\"http://localhost:8848\"],\n          username: \"nacos\",\n          password: \"nacos\",\n        },\n        watchInterval: 5000, // Instance watch interval (ms)\n        heartbeatInterval: 5000, // Heartbeat interval (ms)\n      },\n    }),\n  ],\n  controllers: [DiscoveryController],\n  providers: [DiscoveryService],\n})\nclass AppModule {}\n\nconst app = new Application();\napp.registerModule(AppModule);\napp.listen(3000);\n```\n\n### Using ServiceClient for Inter-Service Communication\n\n```typescript\nimport {\n  Inject,\n  Injectable,\n  RequestLogInterceptor,\n  ResponseLogInterceptor,\n  SERVICE_REGISTRY_TOKEN,\n  ServiceClient,\n  type ServiceRegistry,\n  TraceIdRequestInterceptor,\n} from \"@dangao/bun-server\";\n\n@Injectable()\nclass UserService {\n  private readonly serviceClient: ServiceClient;\n\n  public constructor(\n    @Inject(SERVICE_REGISTRY_TOKEN) serviceRegistry: ServiceRegistry,\n  ) {\n    this.serviceClient = new ServiceClient(serviceRegistry);\n\n    // Add interceptors\n    this.serviceClient.addRequestInterceptor(new TraceIdRequestInterceptor());\n    this.serviceClient.addRequestInterceptor(new RequestLogInterceptor());\n    this.serviceClient.addResponseInterceptor(new ResponseLogInterceptor());\n  }\n\n  public async getUser(id: string): Promise<unknown> {\n    const response = await this.serviceClient.call({\n      serviceName: \"user-service\",\n      method: \"GET\",\n      path: `/api/users/${id}`,\n      loadBalanceStrategy: \"roundRobin\",\n      timeout: 5000,\n      // Circuit breaker support\n      enableCircuitBreaker: true,\n      fallback: () => ({ id, name: \"Fallback User\" }),\n    });\n    return response.data;\n  }\n\n  public async createUser(data: unknown): Promise<unknown> {\n    const response = await this.serviceClient.call({\n      serviceName: \"user-service\",\n      method: \"POST\",\n      path: \"/api/users\",\n      body: data,\n      loadBalanceStrategy: \"weightedRoundRobin\",\n      // Rate limiting support\n      enableRateLimit: true,\n      rateLimitKey: \"user-service-create\",\n    });\n    return response.data;\n  }\n}\n```\n\n### Load Balancing Strategies\n\nThe framework supports multiple load balancing strategies:\n\n- `random` - Random selection\n- `roundRobin` - Round-robin selection\n- `weightedRoundRobin` - Weighted round-robin based on instance weights\n- `consistentHash` - Consistent hashing (requires `consistentHashKey`)\n- `leastActive` - Least active connections\n\n### Service Governance Features\n\n```typescript\n// Configure circuit breaker\nserviceClient.setDefaultCircuitBreakerOptions({\n  failureThreshold: 0.5, // 50% failure rate triggers circuit open\n  timeWindow: 60000, // Time window for failure calculation (ms)\n  minimumRequests: 10, // Minimum requests before circuit can open\n  openDuration: 60000, // Duration circuit stays open (ms)\n  halfOpenRequests: 3, // Requests allowed in half-open state\n});\n\n// Configure rate limiter\nserviceClient.setDefaultRateLimiterOptions({\n  requestsPerSecond: 100,\n  timeWindow: 1000,\n});\n\n// Configure retry strategy\nserviceClient.setDefaultRetryStrategy({\n  maxRetries: 3,\n  retryDelay: 1000,\n  exponentialBackoff: true,\n  baseDelay: 1000,\n  maxDelay: 30000,\n});\n```\n\n## Namespace\n\nNacos 3.x Open API requires every request to include a `namespaceId` parameter. The default namespace shown as **public** in the console maps to an **empty string** `\"\"`, not the literal `\"public\"`.\n\n- When `namespaceId` is not set on `NacosClient`, the client automatically sends `namespaceId=` (empty value) on `getConfig`, `registerInstance`, `deregisterInstance`, `getInstances`, and related calls\n- For a custom namespace, pass the namespace ID from the console (usually a UUID)\n- **0.1.1 and earlier** omitted the parameter when unset, causing Nacos 3.x to return `code=20004`; use **0.1.2+**\n- If you patched `@dangao/nacos-client@0.1.1` with `bun patch`, remove `patchedDependencies` and the patch file after upgrading\n\n```typescript\n// Public namespace (recommended: omit namespaceId)\nconst publicClient = new NacosClient({ serverList: [\"http://localhost:8848\"] });\n\n// Custom namespace\nconst customClient = new NacosClient({\n  serverList: [\"http://localhost:8848\"],\n  namespaceId: \"your-namespace-uuid\",\n});\n```\n\n## Nacos Compatibility\n\nThis client is designed for **Nacos 3.X** and uses the following Open API\nendpoints:\n\n- Configuration: `GET /nacos/v3/client/cs/config`\n- Service Registration: `POST /nacos/v3/client/ns/instance`\n- Service Deregistration: `DELETE /nacos/v3/client/ns/instance`\n- Service Discovery: `GET /nacos/v3/client/ns/instance/list`\n\n## Related Documentation\n\n- [Bun Server Framework Documentation](https://github.com/dangaogit/bun-server)\n- [Nacos Official Documentation](https://nacos.io/docs/latest/)\n- [Nacos 3.X Open API](https://nacos.io/docs/latest/manual/user/open-api/)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}