kylebarron / parquet-wasm

Rust-based WebAssembly bindings to read and write Apache Parquet data
https://kylebarron.dev/parquet-wasm/
Apache License 2.0
482 stars 19 forks source link

fix package exports #414

Closed kylebarron closed 2 months ago

llimllib commented 3 months ago

Confirmed that with a build made with this patch, this code works on node 20.11.1:

import * as Arrow from "apache-arrow";
import * as Parquet from "parquet-wasm";

const table = Arrow.tableFromArrays({ test: [42] });
process.stdout.write(
  Parquet.writeParquet(
    Parquet.Table.fromIPCStream(Arrow.tableToIPC(table, "stream")),
  ),
);
kylebarron commented 3 months ago

Thanks! I just need to update this PR now that we don't have arrow2 and then I can merge

github-actions[bot] commented 2 months ago

Asset Sizes

AssetUncompressed SizeCompressed Size
async_full/parquet_wasm_bg.wasm5.24MB +0B +0%1.18MB $\color{green}\textbf{-715B -0\%}$
slim/parquet_wasm_bg.wasm3.45MB +0B +0%532KB $\color{green}\textbf{-206B -0\%}$
sync/parquet_wasm_bg.wasm4.71MB +0B +0%1MB $\color{red}\textbf{+566B +0\%}$
kylebarron commented 2 months ago

For some reason the types still aren't loading in some environments, but this is still progress.

andresgutgon commented 1 month ago

Hi, I'm trying this package in a nodejs script. I have a question. initWasm doesn't look necessary if we use nodejs. Is that correct?

kylebarron commented 1 month ago

As long as you use the Node entry point, that is correct. But if you're using the /esm entry point from Node, you still need to call initWasm