question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PackrStream does not have the correct typing to .pipe()

See original GitHub issue

I am using msgpackr in a TypeScript project.

This is my code:

const writeStream = fs.createWriteStream(`file.msp`);
const encodeStream = new PackrStream();
encodeStream.pipe(writeStream);

Getting the following error: TypeScript error: Property 'pipe' does not exist on type 'PackrStream'.

Can you add the pipe property to the type PackrStream?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kriszypcommented, Jul 22, 2021

Ok, sorry for missing those, and thank you for the clue about the node version. Fixes for typings and stream methods should be in v1.3.9.

0reactions
bobsingorcommented, Jul 22, 2021

When I run the streaming/writing part of your code, it seems to properly write to the file. Perhaps this is a timing issue of checking the file before the write finishes? You can explicitly end the stream and await for its completion like in the unit test: https://github.com/kriszyp/msgpackr/blob/master/tests/test-node-stream.js#L66

@kriszyp Ok I found out that it’s only working in node 15+

Read more comments on GitHub >

github_iconTop Results From Across the Web

msgpackr - GitHub
Ultra-fast MessagePack implementation with extension for record and structural cloning / msgpack.org[JavaScript/NodeJS] - GitHub - kriszyp/msgpackr: ...
Read more >
MessagePack: It's like JSON. but fast and small.
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller.
Read more >
Bolt Protocol message specification - Neo4j
The message type is denoted by the PackStream structure tag byte and each message is defined in the Bolt protocol. Serialization is specified...
Read more >
Javascript/node : Problem using pipe method from a ...
I wanted to pass a text file's content to the server via the pipe method via the following code. const {createServer}=require('http'); ...
Read more >
[ANNOUNCE] Git v2.20.0-rc2 - Google Groups
A release candidate Git v2.20.0-rc2 is now available for testing at the usual places. It is comprised of 934 non-merge commits
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found