Registry / data / hyparquet-writer

hyparquet-writer

JSON →
library0.15.6jsnpmunverified

Hyparquet Writer is a JavaScript library for writing Apache Parquet files, focused on being lightweight and fast. Current stable version is 0.15.6, with active development on GitHub under the hyparam organization. It is a companion to the hyparquet reader library. Key differentiators: pure JavaScript with no native dependencies, supports a wide range of Parquet logical types (STRING, JSON, TIMESTAMP, UUID, FLOAT16, GEOMETRY, etc.), automatic type inference, and optional SNAPPY compression. It outputs Parquet files compatible with the Parquet specification.

npm install hyparquet-writer
INSTALL
IMPORT
SIG · HYPARQUET-WRITER
H
hyparquet-writer
datajavascriptv0.15.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parquetWriteBuffer
import { parquetWriteBuffer } from 'hyparquet-writer'
const { parquetWriteBuffer } = require('hyparquet-writer')
Package is ESM-only; CommonJS require() will fail unless using dynamic import()
parquetWriteFile
import { parquetWriteFile } from 'hyparquet-writer'
import { parquetWriteFile } from 'hyparquet-writer/src'
Only top-level exports are supported; don't use subpath imports
ParquetWriteOptions
import { ParquetWriteOptions } from 'hyparquet-writer'
TypeScript type; can be imported even if not used at runtime

Demonstrates writing a Parquet file to an ArrayBuffer with two typed columns using parquetWriteBuffer.

import { parquetWriteBuffer } from 'hyparquet-writer'; // Create an ArrayBuffer containing a Parquet file with two columns const arrayBuffer = parquetWriteBuffer({ columnData: [ { name: 'name', data: ['Alice', 'Bob', 'Charlie'], type: 'STRING' }, { name: 'age', data: [25, 30, 35], type: 'INT32' }, ], }); // The buffer can be written to disk or sent over the network const uint8Array = new Uint8Array(arrayBuffer);
Debug
Known issues
breakingIn version 0.15.0, the API changed from exporting a default function to named exports. Previously you could import parquetWriteBuffer as default.
fix
Use named imports: import { parquetWriteBuffer } from 'hyparquet-writer' instead of import parquetWriteBuffer from 'hyparquet-writer'.
affects: <0.15.0
gotchaThe package is ESM-only and cannot be require()'d directly. Attempting const { parquetWriteBuffer } = require('hyparquet-writer') throws an error.
fix
Use import or dynamic import: const { parquetWriteBuffer } = await import('hyparquet-writer')
affects: >=0.15.0
gotchaType inference may guess wrong types if data contains mixed types or is empty. Always provide explicit type to avoid runtime errors.
fix
Specify the 'type' property for each column in columnData. Supported types: BOOLEAN, INT32, INT64, FLOAT, DOUBLE, BYTE_ARRAY, STRING, JSON, TIMESTAMP, UUID, FLOAT16, GEOMETRY, GEOGRAPHY, VARIANT.
affects: >=0.1.0
deprecatedThe 'version' option in ParquetWriteOptions is deprecated and may be removed in future versions.
fix
Remove the 'version' option from ParquetWriteOptions.
affects: >=0.14.0
Errors
Common errors & fixes
TypeError: hyparquet_writer_1.default is not a function
Incorrect default import when using an older version or outdated examples.
fix
Use a named import: import { parquetWriteBuffer } from 'hyparquet-writer'
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require() on an ESM package.
fix
Use dynamic import: const { parquetWriteBuffer } = await import('hyparquet-writer')
RangeError: Invalid typed array length
Passing data that cannot be serialized to the given type (e.g., string in INT32 column).
fix
Ensure data type matches the specified or inferred type. Use JSON.stringify for JSON columns.
Upgrade
Version history
0.15.6latest on npm
Audit
Dependencies
snappyjsrequiredSNAPPY compression codec (included as dependency)
Agent activity
5 hits · last 30 days
node
4
Resources
hyparquet-writer — npm install hyparquet-writer · libregistry