-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Inherit from Stream
#8
Inherit from Stream
#8
Conversation
…ives us `.pipe()`.
…Object is passed to the 'SerialPort' constructor.
I like the stream change, but not the options change. I do want to know what/if any (beyond to be more inline with other node concepts) moving to pipe gets us. Ping me at voodootikigod any IM/IRC we can chat. |
You like the options change, I think you just don't know it yet :P And ya, the Stream change is just to be more in line with the Node APIs. More specifically, I would like to implement the serial side of the Modbus protocol in my But that requires the underlying stream to be a real instance of Stream, otherwise the StreamStack constructor will throw an error, so this patch will allow me to use the serialport "stream" instance with StreamStack: I'll be on #Node.js today if you want to chat more about it! |
I dig the revision, hybrid of the two. I am not a fan of using proto but can forgo my purist sensibles in favor of the cleanliness (and compactness) of it. |
Here's a few commit's that make the 'SerialPort' class inherit from
stream.Stream
, rather than EventEmitter. This gives us the.pipe()
function. I've also included a commit that does better handling of the 'options' argument when creating a 'SerialPort' instance.This lib is fun though! Can't wait to try it with some real hardware!