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

arrow-flight-client

v0.0.6

Published

Apache Arrow Flight Client for Node.js

Readme

Apache Arrow Flight Client for Node.js

License

npm

⚠️ Experimental — API may change before v1.0.0

Apache Arrow Flight client implementation for Node.js®. Native gRPC-based client built on top of apache-arrow, nice-grpc, and official Arrow Flight protobuf definitions.

To improve reliability and maintainability the code is based TypeScript. Streaming support (DoGet, DoPut). Compatible with:

  • PyArrow Flight Server
  • DuckDB Flight
  • Arrow Java / C++ servers

Getting Started

Installation

To use Flight Client in your project, run:

npm install arrow-flight-client

Requires Node.js ≥ 18

Table of Contents

class FlightClient

constructor: new FlightClient(address, options)

  • address <String> The address of the Arrow Flight gRPC server (e.g. localhost:8815).
  • options <Object>
    • tls <Boolean> includes an implementation of the Transport Layer Security (TLS) and Secure Socket Layer (SSL) protocols, built on top of OpenSSL. Default: false.
    • metadata Default: undefined.

Create a client:

import { FlightClient } from 'arrow-flight-client';
s
const client = new FlightClient('localhost:8815');

Authentication & Metadata. You can pass metadata headers (e.g. auth tokens):

const client = new FlightClient('localhost:8815', {
  metadata: {
    authorization: 'Bearer my-token'
  }
});

flightClient.close()

  • returns: <Promise> Following successful read, the Promise is resolved with an value with a undefined.

Premature connection close before the response is received.

flightClient.grpc

Returns the internal gRPC client (readonly).

listFlights(client)

  • client <FlightClient> gRPC client.
  • returns: <Promise> Following successful read, the Promise is resolved with an value with a Array. List available flights.

Returns all available flights from the server:

import { listFlights } from 'arrow-flight-client';

const flights = await listFlights(client);
console.log(flights);

getFlightInfo(client, descriptor)

import { getFlightInfo } from 'arrow-flight-client';

const descriptor = {
  type: FlightDescriptor_DescriptorType.PATH,
  path: ['example']
};
const info = await getFlightInfo(client, descriptor);
console.log(info);

doGetTable(client, ticket)

Fetches Arrow Table via DoGet and returns an apache-arrow:

import { doGetTable } from 'arrow-flight-client';

const flight = flights[0];
const ticket = flight.endpoint[0].ticket.ticket;
const table = await doGetTable(client, ticket);
console.log(
  table.toString()
);

See FlightData stream:

for await (const batch of client.grpc.doGet(ticket)) {
  console.log(batch);
}

doPutTable(client, table, path)

Uploads an Arrow Table via DoPut.

import { doPutTable } from 'arrow-flight-client';
import { tableFromArrays } from 'apache-arrow';

const table = tableFromArrays({
  id: [1, 2, 3],
  name: ['Alice', 'Bob', 'Carol']
});

await doPutTable(client, table, ['example', 'table']);

🧠 Implementation Notes

  • This client uses gRPC streaming under the hood

  • Arrow data is transferred using Arrow IPC

  • Built on:

    • apache-arrow
    • nice-grpc
    • ts-proto

Implementation details

  • Built on top of ts-proto generated Flight protobuf definitions
  • Uses nice-grpc v2.x (async generator–based API)
  • Strict TypeScript types (no any, no unsafe casts)
  • gRPC metadata is handled via client middleware

📚 Build

  • Build TS services from proto files.
  • See: https://github.com/stephenh/ts-proto
  • Get proto files: https://github.com/apache/arrow
protoc \
  --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto \
  --proto_path=./contracts \
  --ts_proto_out=./src/generated \
  --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false \
  --ts_proto_opt="env=node" \
  --ts_proto_opt="esModuleInterop=true" \
  ./contracts/*.proto

🛣 Roadmap

  • [ ] Proper Arrow IPC streaming (RecordBatchReader)
  • [ ] DoExchange
  • [*] Middleware support
  • [ ] TLS configuration helpers

Limitations (current)

  • DoExchange not yet implemented
  • IPC parsing currently buffers the full stream (streaming batches planned)
  • No server implementation (client only)

🚧 Project Status

This library is currently experimental.

  • The Flight protocol implementation is functional
  • The API is not yet considered stable
  • Breaking changes may occur between minor releases

Once the API stabilizes, the project will follow semantic versioning starting from v1.0.0.