parquet-wasm icon indicating copy to clipboard operation
parquet-wasm copied to clipboard

fix package exports

Open kylebarron opened this issue 2 years ago • 2 comments

kylebarron avatar Dec 14 '23 23:12 kylebarron

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")),
  ),
);

llimllib avatar Mar 14 '24 13:03 llimllib

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

kylebarron avatar Mar 14 '24 18:03 kylebarron

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\%}$

github-actions[bot] avatar Apr 12 '24 17:04 github-actions[bot]

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

kylebarron avatar Apr 12 '24 17:04 kylebarron

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?

andresgutgon avatar May 24 '24 08:05 andresgutgon

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

kylebarron avatar May 27 '24 08:05 kylebarron