.npy (single array), .npz (multiple arrays), and delimited text files. The API is split across two entry points to keep browser bundles free of Node.js dependencies.
Node.js functions read and write files on disk. Browser functions work with
ArrayBuffer, Uint8Array, and strings — you handle the network or file access yourself.NPY files (single array)
The.npy format stores a single array with its dtype and shape metadata.
- Node.js
- Browser
NPZ archives (multiple arrays)
The.npz format stores multiple named arrays in a single ZIP archive. savez_compressed applies deflate compression.
- Node.js
- Browser
Text files
Load and save delimited text files such as CSV and TSV.- Node.js
- Browser
Flexible text loading
genfromtxt
Likeloadtxt, but handles missing values more gracefully.
- Node.js
- Browser
fromregex
Extract numeric data from unstructured text using regular expressions.- Node.js
- Browser
Why a separate Node.js entry point?
File I/O functions that read and write to the filesystem are in
numpy-ts/node because they depend on Node.js built-in modules (fs, fs/promises). Keeping them in a separate entry point means that numpy-ts and numpy-ts/core never import fs, so they work cleanly in browsers and edge runtimes without bundler polyfills.If you only need serialization and parsing (not disk access), use serializeNpy, parseNpy, serializeNpz, parseNpz, serializeTxt, and parseTxt from the main entry points.