Improve typescript documentation/support
Kheirlb opened this issue · 2 comments
Kheirlb commented
Hello! Really excited to see the folks here merge in some typescript support! I'm having trouble getting started though and I was wondering if someone can take a pass at updating the documentation? Thanks!
For example, it would be nice to have something as simple as below in the README. I can create the PR if that is helpful.
import { createRawChannel, Message } from "socketcan";
const channel = createRawChannel("vcan0", true);
// Log any message
channel.addListener("onMessage", function(msg: Message) { console.log(msg); });
// Reply any message
channel.addListener("onMessage", channel.send, channel);
channel.start();
sebi2k1 commented
Hey! That's a great idea and I'd appreciate a PR. Thanks.
jbcpollak commented
Here's a sample project I just drafted, I hope its a good starting point: