Skip to content

Reading data in Electron Render Process #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
martin-loland opened this issue Apr 4, 2025 · 0 comments
Open

Reading data in Electron Render Process #163

martin-loland opened this issue Apr 4, 2025 · 0 comments

Comments

@martin-loland
Copy link

Hello, I was wondering what is the recommended approach (or if it's even possible) to read data from parquet file in the render process of an Electron app?

Working in main process

import { readFileSync } from 'node:fs';
const parquet = require('@dsnp/parquetjs');

export async function readParquet(filePath: string) {
  const buffer = readFileSync(filePath);
  const reader = await parquet.ParquetReader.openBuffer(buffer);
  const meta = reader.getMetadata();
  console.log(meta);
}

Not working in render process

import parquetjs from '@dsnp/parquetjs/dist/browser/parquetjs.esm'

const buffer = window.electronAPI.fs.readFileSync(f);
console.log('Expecting PAR1:', new TextDecoder().decode(buffer.slice(0, 4)));
const reader = await parquetjs.ParquetReader.openBuffer(buffer);
const meta = reader.getMetadata();
console.log(meta);

Logs:

Expecting PAR1: PAR1
not valid parquet file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant