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

@viet1846/trino-client

v0.2.8

Published

Trino client library

Readme

trino-js-client

A Trino client for Node.js.

Join us on Trino Slack in #core-dev to discuss and help this project.

@latest it-tests license

Features

  • Connections over HTTP or HTTPS
  • Supports HTTP Basic Authentication
  • Per-query user information for access control

Requirements

  • Node 12 or newer.
  • Trino 0.16x or newer.

Install

npm install trino-client or yarn add trino-client

Usage

For additional info on all available methods and types have a look at the API documentation.

Create a Trino client

const trino: Trino = Trino.create({
  server: 'http://localhost:8080',
  catalog: 'tpcds',
  schema: 'sf100000',
  auth: new BasicAuth('test'),
});

Submit a query

const iter: Iterator<QueryResult> = await trino.query(
  'select * from customer limit 100'
);

Iterate through the query results

for await (const queryResult of iter) {
  console.log(queryResult.data);
}

Alternative: map and aggregate the data

const data: QueryData[] = await iter
  .map(r => r.data ?? [])
  .fold<QueryData[]>([], (row, acc) => [...acc, ...row]);

Examples

More usage examples can be found in the integration tests.

Build

Use the following commands to build the project locally with your modifications, and in preparation to contribute a pull request.

Requirements:

  • yarn

Install dependencies:

yarn install --frozen-lockfile

Lint the source code:

yarn test:lint

Build:

yarn build

A successful build run does not produce any message on the terminal.

Integration test

Integration tests run against a Trino server running on your workstation.

Requirements:

Create a cluster:

kind create cluster

Deploy Trino:

kubectl apply -f tests/it/trino.yml

Wait for pods to be ready:

kubectl wait --for=condition=ready pods -n trino-system --all --timeout=120s

Ensure Trino is running and available on port 8080. Run the following command in a separate terminal:

kubectl -n trino-system port-forward svc/trino 8080:8080

Run tests:

yarn test:it --testTimeout=60000

Output should look similar to the following:

 PASS  tests/it/client.spec.ts
  trino
    ✓ exhaust query results (1567 ms)
    ✓ close running query (200 ms)
    ✓ cancel running query (17 ms)
    ✓ get query info (1 ms)
    ✓ client extra header propagation
    ✓ query request header propagation (88 ms)
    ✓ QueryResult has error info
    ✓ QueryInfo has failure info (1 ms)
    ✓ prepare statement (98 ms)
    ✓ multiple prepare statement (432 ms)

Test Suites: 1 passed, 1 total
Tests:       10 passed, 10 total
Snapshots:   0 total
Time:        3.457 s
Ran all test suites matching /tests\/it/i.

Remove the cluster:

kind delete cluster

Contributing

Follow the Trino contribution guidelines and contact us on Slack and GitHub.

Copyright Trino JS Client contributors 2022-present

Releasing

Releases are automated with GitHub Actions and only require a pull request that updates the version in package.json. For example, see PR 723