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

@hotglue/gluestick-ts

v0.1.7

Published

TypeScript version of the gluestick ETL library for hotglue IPaaS platform

Readme

Gluestick TypeScript

A powerful TypeScript library for data processing and ETL operations on the hotglue IPaaS platform, built with Polars for high-performance data manipulation. Supports multiple export formats including CSV, JSON, Parquet, and Singer specification.

Installation

npm install @hotglue/gluestick-ts

npm version

Quick Start

import * as gs from '@hotglue/gluestick-ts';

// Create a Reader to access your data
const reader = new gs.Reader();

// Get available data streams
const streams = reader.keys();
console.log('Available streams:', streams);

// Read and process a specific stream
const dataFrame = reader.get('your_stream_name', { catalogTypes: true });

// Export processed data (defaults to singer)
gs.toExport(dataFrame, 'output_name', './etl-output');

// Export as CSV
gs.toExport(dataFrame, 'output_name', './etl-output', { exportFormat: 'csv' });

Core Components

Reader Class

The Reader class is your main interface for accessing data streams:

const reader = new gs.Reader(inputDir?, rootDir?);

Methods:

  • get(stream, options) - Read a specific stream as a Polars DataFrame
  • keys() - Get all available stream names
  • getPk(stream) - Get primary keys for a stream from catalog

Options:

  • catalogTypes: boolean - Use catalog for automatic type inference
  • Other options will be passed through to Polars when reading. See ReadCSV and ReadParquet options for more information

Export Functions

Export your processed data in multiple formats:

gs.toExport(dataFrame, outputName, outputDir, options?);

Supported formats:

  • Singer (default) - Singer specification format for data integration
  • CSV - Comma-separated values
  • JSON - Single JSON array
  • JSONL - Newline-delimited JSON
  • Parquet - Columnar storage format

Development

Build the project:

npm run build

Run examples:

# Run CSV processing example
npm run run:example:csv

# Run Parquet processing example  
npm run run:example:parquet

API Reference

Reader Constructor

new Reader(inputDir?: string, rootDir?: string)
  • inputDir - Custom input directory (default: ${rootDir}/sync-output)
  • rootDir - Root directory (default: process.env.ROOT_DIR || '.')

Reader Methods

get(stream: string, options?: ReadOptions): DataFrame | null

Read a data stream as a Polars DataFrame.

const df = reader.get('users', { catalogTypes: true });

Options:

  • catalogTypes: boolean - Use catalog for automatic type inference

keys(): string[]

Get all available stream names.

const streams = reader.keys();
// Returns: ['users', 'orders', 'products']

getPk(stream: string): string[] | null

Get primary keys for a stream from the catalog.

const primaryKeys = reader.getPk('users');
// Returns: ['id']

Export Function

toExport(
  dataFrame: DataFrame,
  outputName: string,
  outputDir: string,
  options?: ExportOptions
): void

Parameters:

  • dataFrame - Polars DataFrame to export
  • outputName - Name for the output file (without extension)
  • outputDir - Directory to write the output file
  • options - Export configuration options

Export Options:

interface ExportOptions {
  exportFormat?: 'csv' | 'json' | 'jsonl' | 'parquet' | 'singer';
  outputFilePrefix?: string;
  keys?: string[];  // Primary keys for the data
  stringifyObjects?: boolean;
  reservedVariables?: Record<string, string>;
  allowObjects?: boolean;  // For Singer format
  schema?: SingerHeaderMap;  // For Singer format
}

Examples:

// Export as CSV with prefix
gs.toExport(dataFrame, 'processed_users', './output', {
  exportFormat: 'csv',
  outputFilePrefix: 'tenant_123_',
  keys: ['user_id']
});

// Export as Singer format
gs.toExport(dataFrame, 'processed_users', './output', {
  exportFormat: 'singer',
  allowObjects: true,
  keys: ['user_id']
});

Singer Format Support

Export data in Singer specification format for data integration pipelines:

// Basic Singer export
gs.toExport(dataFrame, 'users', './output', {
  exportFormat: 'singer',
  keys: ['id']
});

// Singer export with object support
gs.toExport(dataFrame, 'users', './output', {
  exportFormat: 'singer',
  allowObjects: true,
  keys: ['id']
});

The Singer export automatically generates SCHEMA, RECORD, and STATE messages according to the Singer specification.