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

@devrev/meerkat-browser

v0.0.117

Published

`@devrev/meerkat-browser` is a library for converting cube queries into SQL and executing them in a browser environment using [@duckdb/duckdb-wasm](https://github.com/duckdb/duckdb-wasm). It serves as a client-side query engine within the Meerkat ecosyste

Readme

@devrev/meerkat-browser

@devrev/meerkat-browser is a library for converting cube queries into SQL and executing them in a browser environment using @duckdb/duckdb-wasm. It serves as a client-side query engine within the Meerkat ecosystem.

This package uses @devrev/meerkat-core to generate a DuckDB-compatible AST and @duckdb/duckdb-wasm to execute the resulting query against data sources available to the browser.

Key Features

  • Cube to SQL Execution: Translates cube queries into SQL and executes them in the browser.
  • Browser Optimized: Built to work seamlessly with @duckdb/duckdb-wasm.
  • Client-Side Analytics: Enables powerful, in-browser data analysis without a server round-trip.

Installation

npm install @devrev/meerkat-browser @devrev/meerkat-core @duckdb/duckdb-wasm

@duckdb/duckdb-wasm is a peer dependency and should be configured according to its documentation.

Usage

Here's a example of how to convert a cube query into SQL and execute the query in the client side with duckdb-wasm.

import * as duckdb from '@duckdb/duckdb-wasm';
import { cubeQueryToSQL } from '@devrev/meerkat-browser';
import { Query, TableSchema } from '@devrev/meerkat-core';

async function main() {
  // 1. Initialize DuckDB-WASM
  const logger = new duckdb.ConsoleLogger();
  const worker = new Worker(duckdb.getJsDelivrWorker());
  const bundle = await duckdb.selectBundle(duckdb.getJsDelivrBundles());
  const db = new duckdb.AsyncDuckDB(logger, worker);
  await db.open(bundle);
  const connection = await db.connect();

  // 2. Define your table schemas
  const tableSchemas: TableSchema[] = [
    {
      name: 'users',
      // The SQL could point to a registered file or another data source
      sql: 'SELECT * FROM users',
      columns: [
        { name: 'id', type: 'INTEGER' },
        { name: 'name', type: 'VARCHAR' },
        { name: 'city', type: 'VARCHAR' },
        { name: 'signed_up_at', type: 'TIMESTAMP' },
      ],
    },
  ];

  // 3. Define your Cube query
  const query: Query = {
    measures: ['users.count'],
    dimensions: ['users.city'],
    filters: [
      {
        member: 'users.city',
        operator: 'equals',
        values: ['New York'],
      },
    ],
    limit: 100,
  };

  // 4. Convert the query to SQL
  const sqlQuery = await cubeQueryToSQL({
    connection,
    query,
    tableSchemas,
  });

  // 5. You can now execute the generated SQL query with DuckDB
  const result = await connection.query(sqlQuery);

  console.log(
    'Query Results:',
    result.toArray().map((row) => row.toJSON())
  );
}

main();