Skip to content

Working with Arrow in TypeScript

Apache Arrow IPC file handling with high-performance columnar data processing.

Terminal window
npm install fairspec

The Arrow plugin provides:

  • loadArrowTable - Load Arrow IPC files into tables
  • saveArrowTable - Save tables to Arrow IPC files
  • ArrowPlugin - Plugin for framework integration

For example:

import { loadArrowTable } from "fairspec"
const table = await loadArrowTable({ data: "table.arrow" })
// High-performance columnar format
import { loadArrowTable } from "fairspec"
// Load from local file
const table = await loadArrowTable({ data: "data.arrow" })
// Load from remote URL
const table = await loadArrowTable({
data: "https://example.com/data.arrow"
})
// Load multiple files (concatenated)
const table = await loadArrowTable({
data: ["file1.arrow", "file2.arrow"]
})
import { saveArrowTable } from "fairspec"
// Save with default options
await saveArrowTable(table, { path: "output.arrow" })
// Save with explicit format
await saveArrowTable(table, {
path: "output.arrow",
format: { name: "arrow" }
})
// Load from URL
const table = await loadArrowTable({
data: "https://example.com/data.arrow"
})
// Load multiple remote files
const table = await loadArrowTable({
data: [
"https://api.example.com/data-2023.arrow",
"https://api.example.com/data-2024.arrow"
]
})