{"name":"@clickhouse/client-common","version":"1.0.2","keywords":["clickhouse","sql","client"],"license":"Apache-2.0","_id":"@clickhouse/client-common@1.0.2","maintainers":[{"name":"vineethasok","email":"me@vineethasok.com"},{"name":"serdec","email":"sdecri@gmail.com"},{"name":"mikhail.shustov-clickhouse","email":"mikhail.shustov@clickhouse.com"},{"name":"serge.klochkov","email":"hypnoash@gmail.com"}],"homepage":"https://clickhouse.com","bugs":{"url":"https://github.com/ClickHouse/clickhouse-js/issues"},"dist":{"shasum":"0fe0a4b33101c08d85c1279e4d74b2a92d42d996","tarball":"http://registry-npm.ywwl.com/@clickhouse/client-common/download/@clickhouse/client-common-1.0.2.tgz","fileCount":60,"integrity":"sha512-5oI2URFsXlzoysv5lAxoTUAnAHjXnaJ+1Jz3HUARR06Hkbr1sN0pGxfGwgjEd8E/lI4+UNdNEZicG2rlFnWSaA==","signatures":[{"sig":"MEYCIQCjavEpvSaOm7Upzph5ty0n275offR71v3h4+5kLVlwegIhAJUCoKk1IeKNUUKvEjW9m5ok4/v0VbfLN1LHE8JAU5o/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":269012,"size":69684,"noattachment":false,"key":"/@clickhouse/client-common/-/@clickhouse/client-common-1.0.2.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ad8611e736a82d98416c1d99d903240df02d7ace","private":false,"_npmUser":{"name":"serge.klochkov","email":"hypnoash@gmail.com"},"repository":{"url":"git+https://github.com/ClickHouse/clickhouse-js.git","type":"git"},"_npmVersion":"10.2.3","description":"Official JS client for ClickHouse DB - common types","directories":{},"_nodeVersion":"20.10.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/client-common_1.0.2_1716220927421_0.37192048490344365","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: import from @clickhouse/client or @clickhouse/client-web instead.","readme":"<p align=\"center\">\n<img src=\".static/logo.svg\" width=\"200px\" align=\"center\">\n<h1 align=\"center\">ClickHouse JS client</h1>\n</p>\n<br/>\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@clickhouse/client\">\n<img alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/%40clickhouse%2Fclient?color=%233178C6&logo=npm\">\n</a>\n\n<a href=\"https://www.npmjs.com/package/@clickhouse/client\">\n<img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dw/%40clickhouse%2Fclient?color=%233178C6&logo=npm\">\n</a>\n\n<a href=\"https://github.com/ClickHouse/clickhouse-js/actions/workflows/tests-node.yml\">\n<img src=\"https://github.com/ClickHouse/clickhouse-js/actions/workflows/tests-node.yml/badge.svg?branch=main\">\n</a>\n\n<a href=\"https://github.com/ClickHouse/clickhouse-js/actions/workflows/tests-web.yml\">\n<img src=\"https://github.com/ClickHouse/clickhouse-js/actions/workflows/tests-web.yml/badge.svg?branch=main\">\n</a>\n\n<a href=\"https://codecov.io/gh/ClickHouse/clickhouse-js\">\n<img src=\"https://codecov.io/gh/ClickHouse/clickhouse-js/graph/badge.svg?token=B832WB00WJ\">\n</a>\n\n<img src=\"https://api.scorecard.dev/projects/github.com/ClickHouse/clickhouse-js/badge\">\n</p>\n\n## About\n\nOfficial JS client for [ClickHouse](https://clickhouse.com/), written purely in TypeScript, thoroughly tested with actual ClickHouse versions.\n\nThe client has zero external dependencies and is optimized for maximum performance.\n\nThe repository consists of four packages:\n\n- `@clickhouse/client` - a version of the client designed for Node.js platform only. It is built on top of [HTTP](https://nodejs.org/api/http.html)\n  and [Stream](https://nodejs.org/api/stream.html) APIs; supports streaming for both selects and inserts.\n- `@clickhouse/client-web` - a version of the client built on top of [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)\n  and [Web Streams](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) APIs; supports streaming for selects.\n  Compatible with Chrome/Firefox browsers and Cloudflare workers.\n- `@clickhouse/client-common` - shared common types and the base framework for building a custom client implementation.\n- `@clickhouse/rowbinary` - a library for reading (and soon writing) ClickHouse RowBinary format.\n\n## Installation\n\nNode.js client:\n\n```sh\nnpm i @clickhouse/client\n```\n\nWeb client (browsers, Cloudflare workers):\n\n```sh\nnpm i @clickhouse/client-web\n```\n\n## Environment requirements\n\n### Node.js\n\nNode.js must be available in the environment to run the Node.js client. The client is compatible with all the [maintained](https://github.com/nodejs/release#readme) Node.js releases.\n\n| Node.js version | Supported? |\n| --------------- | ---------- |\n| 26.x            | ✔          |\n| 24.x            | ✔          |\n| 22.x            | ✔          |\n| 20.x            | ✔          |\n\n### TypeScript\n\nIf using TypeScript, version [4.5](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html) or above is required to enable [inline import and export syntax](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names).\n\n## Compatibility with ClickHouse\n\n| Client version | ClickHouse |\n| -------------- | ---------- |\n| 1.12.0+        | 24.8+      |\n\nThe client may work with older versions too; however, this is best-effort support and is not guaranteed.\n\n## Quick start\n\n```ts\nimport { createClient } from \"@clickhouse/client\"; // or '@clickhouse/client-web'\n\nconst client = createClient({\n  url: process.env.CLICKHOUSE_URL ?? \"http://localhost:8123\",\n  username: process.env.CLICKHOUSE_USER ?? \"default\",\n  password: process.env.CLICKHOUSE_PASSWORD ?? \"\",\n});\n\nconst resultSet = await client.query({\n  query: \"SELECT * FROM system.tables\",\n  format: \"JSONEachRow\",\n});\n\nconst tables = await resultSet.json();\nconsole.log(tables);\n\nawait client.close();\n```\n\nSee more examples in the [examples directory](./examples).\n\n## Documentation\n\nSee the [ClickHouse website](https://clickhouse.com/docs/integrations/javascript) for the full documentation.\n\n## Changelog\n\nEach package keeps its own changelog:\n\n- `@clickhouse/client` — [`packages/client-node/CHANGELOG.md`](./packages/client-node/CHANGELOG.md)\n- `@clickhouse/client-web` — [`packages/client-web/CHANGELOG.md`](./packages/client-web/CHANGELOG.md)\n- `@clickhouse/client-common` (deprecated) — [`packages/client-common/CHANGELOG.md`](./packages/client-common/CHANGELOG.md)\n- `@clickhouse/datatype-parser` — [`packages/datatype-parser/CHANGELOG.md`](./packages/datatype-parser/CHANGELOG.md)\n- `@clickhouse/rowbinary` — [`skills/clickhouse-js-node-rowbinary/CHANGELOG.md`](./skills/clickhouse-js-node-rowbinary/CHANGELOG.md)\n\nHistory through `@clickhouse/client` 1.23.0 lives in the now-frozen repository-wide [`CHANGELOG.md`](./CHANGELOG.md).\n\n## AI Agent Skills\n\nThis repository contains agent skills for working with the client:\n\n- `clickhouse-js-node-troubleshooting` — troubleshooting playbook for the Node.js client.\n\nInstall via CLI:\n\n```sh\n# per project\nnpx skills add ClickHouse/clickhouse-js\n# globally\nnpx skills add ClickHouse/clickhouse-js -g\n```\n\nOr ask your agent to install it for you:\n\n> install agent skills from ClickHouse/clickhouse-js\n\n## Usage examples\n\nWe have a wide range of [examples](./examples), aiming to cover various scenarios of client usage. The overview is available in the [examples README](https://github.com/ClickHouse/clickhouse-js/blob/main/examples/README.md#overview).\n\n## Contact us\n\nIf you have any questions or need help, feel free to reach out to us in the [Community Slack](https://clickhouse.com/slack) (`#clickhouse-js` channel) or via [GitHub issues](https://github.com/ClickHouse/clickhouse-js/issues).\n\n## Contributing\n\nCheck out our [contributing guide](./CONTRIBUTING.md).\n\nIf you'd like to build a client for an alternative runtime (such as Bun or Cloudflare Workers) or an alternative protocol (such as the native ClickHouse protocol or gRPC over a proxy), see [Building specialized clients for alternative runtimes and protocols](./ALTERNATIVE_CLIENTS.md).\n","publish_time":1716220927621,"_cnpm_publish_time":1716220927621,"dist-tags":{"beta":"1.18.2","faster_exception_detection":"0.100.1","head":"1.23.0-head.dbc2960.1","latest":"1.23.0","rc":"1.17.0","tracing_logging_command":"0.4.0"}}