Skip to content
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

How to write objecto store entry to file #640

Open
dakhnod opened this issue Sep 4, 2024 · 0 comments
Open

How to write objecto store entry to file #640

dakhnod opened this issue Sep 4, 2024 · 0 comments
Labels
proposal Enhancement idea or proposal

Comments

@dakhnod
Copy link

dakhnod commented Sep 4, 2024

Proposed change

I attempted running this code, but it fails with the following error:

const natsHandle = await objectBucket.get(`/${path}`);
const writableStream = fs.createWriteStream(path);
await natsHandle.data.pipeTo(writableStream);
Uncaught TypeError TypeError [ERR_INVALID_ARG_TYPE]: The "transform.writable" property must be an instance of WritableStream. Received an instance of WriteStream

My question is:

How do I propertly pipe a nats object contents to a file without loading all the content into ram?

Use case

Could be useful when downloading data from a nats object store to disk.

Contribution

No response

@dakhnod dakhnod added the proposal Enhancement idea or proposal label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

1 participant