npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@awsless/clickhouse-server

v0.0.1

Published

Readme

@awsless/clickhouse-server

A local ClickHouse server for tests and local development, with two engines:

  • memory (default): ClickHouse's HTTP interface and SQL in TypeScript, in-process. No download, no binary, boots in milliseconds.
  • clickhouse: the real ClickHouse binary (26.8 LTS), downloaded once to ~/.cache/awsless/clickhouse and checked against its sha256.
import { ClickHouseServer } from '@awsless/clickhouse-server'

const server = new ClickHouseServer() // in-memory
const server = new ClickHouseServer({ engine: 'clickhouse' }) // real binary

await server.listen()
console.log(server.endpoint) // http://127.0.0.1:<port>
await server.reset() // drop every table
await server.close()

Both run in UTC, like ClickHouse Cloud, and speak enough of the HTTP interface for the official @clickhouse/client: queries in the body or query param, param_* query parameters, settings, gzip, and errors in ClickHouse's own words (Code: 60. DB::Exception: ... (UNKNOWN_TABLE) with X-ClickHouse-Exception-Code).

The in-memory engine

It covers the SQL apps write against a MergeTree table:

  • DDL: CREATE TABLE (MergeTree family, Memory, Log), ALTER (columns, indexes, TTL, settings, comments, DELETE, UPDATE), DROP, TRUNCATE, RENAME, OPTIMIZE ... FINAL, EXISTS, SHOW TABLES, SHOW CREATE TABLE, DESCRIBE, and system.tables, system.columns, system.mutations and friends, with create_table_query written the way ClickHouse writes it.
  • Inserts in JSONEachRow, JSONCompactEachRow, TabSeparated, CSV and VALUES, with defaults, MATERIALIZED columns and best effort date parsing.
  • SELECT with WHERE, GROUP BY, HAVING, ORDER BY (positional, NULLS FIRST/LAST), DISTINCT, LIMIT BY, LIMIT/OFFSET, UNION, WITH, subqueries, IN, joins (INNER, LEFT, RIGHT, FULL, CROSS, ON/USING), ARRAY JOIN, arrayJoin(), FINAL on ReplacingMergeTree & SummingMergeTree, and table functions numbers, zeros, values.
  • About 500 scalar functions (names & aliases) and 70 aggregates: arithmetic, conditionals, conversions, dates in any time zone, strings, regular expressions, arrays with lambdas, maps, tuples, JSON strings and JSON columns; the aggregates take the -If, -Distinct, -Array, -OrNull & -OrDefault combinators, including quantiles, topK, windowFunnel and retention.
  • Output formats: JSONEachRow, JSONCompactEachRow (and its WithNames variants), JSON, JSONCompact, TabSeparated (and variants), CSV (and variants), Values.

Result columns get ClickHouse's names (plus(1, 1), count()), and query parameters are substituted the way ClickHouse substitutes them.

Everything else fails with a ClickHouse-shaped error that names what's missing (NOT_IMPLEMENTED, SYNTAX_ERROR), so a test never silently matches nothing. Not implemented: window functions, -State/-Merge aggregates, materialized views, dictionaries, projections and the native TCP protocol.

uniq, quantile and topK answer exactly where ClickHouse estimates; they agree on the small data tests use.

Conformance

test/conformance.ts runs every case on both engines and requires byte-identical answers (errors compare their code and type). It runs against the real binary whenever it's cached, or with AWSLESS_LOCAL_ENGINE=real, and keeps the verified answers as snapshots for runs without it.