-
Notifications
You must be signed in to change notification settings - Fork 49
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
Can we use web serial port on browser instead running nodejs #109
Comments
I'm thinking about it. |
I think this is nt that true ;-))) But interesting. Maybe I look into it when I finally find time for my GSM project |
I found this package import Modem from 'web-serial-gsm'
async function list_messages_from_gsm_modem() {
const port = await navigator.serial.requestPort()
console.log({ port })
if (port) {
const modem = new Modem(port)
try {
await port.open({ baudRate: 19200 })
modem.startReader();
await modem.startWriter()
await modem.boot()
} catch (e) {
}
const messages = await modem.listMessages()
console.log({ messages })
return messages
}
} I tested and it worked, amazing haha |
Nice catch! i was also looking for this! |
In my refactor of this repository, the use of different communication channels via However, I am unsure about the best way to provide a TypeScript library for both NodeJS and the Web. Greetings Julian |
@KillerJulian SImply proide cros compiled for CJS and ESM 8second fr browsers) ... works good, I do that in other projects |
I don't think that will be enough. The SerialPort dependency must certainly be made an optional dependency. Also, polyfills will probably be needed to use the dependencies provided by NodeJS like "events". A bundler would certainly not be a bad option. However, I think that the choice of bundler and polyfills should be left to the user. I think the topic needs a little more discussion |
I want to use this library in my reactjs project which use Web Serial API, i think we don't need nodejs anymore
So can you help me
https://github.com/nathanjel/serialport-binding-web-serial-api
Thank you
The text was updated successfully, but these errors were encountered: