This is a crazy diff that's unreadable. Prettier has gained a lot of traction I personally like it and a lot of code looks like this these days. It also supports linting and formatting that eslint doesn't on its own. That alone helps keep the code more standard. This PR is equivalent of ripping off a bandaid.
- Add prittier
- `npm run format`
Libraries, LTS support and a large enough amount of users have all dropped node 4. As part of this years [J5 summit](https://github.com/rwaldron/johnny-five/issues/1463) we discussed supporting all Active, Maintenance and Current LTS releases only. This will greatly reduce maintenance overhead and make this maintainer a little bit more happy. The last version of serialport to support node 4 will be `serialport@6`.
- remove "use strict;"
- add engines directives to all package.json's
- drop safe-buffer as they're all safe now
- let eslint-plugin-node use the engines directive
- use new language features in a few random places to feel better about this
- stop including the package-lock.json
- upgrade a few packages
BREAKING: Dropping support for node 4
* 250k baudrate now works
* Generic linux non-standard baudrate setting using termios2
* Tested successfully with an FTDI usb chip with the tx and rx pins bridged. Previous solution using the B38400 hack returned gibberish in same setup.
* Test for linux and win32 baudrate setting. Darwin stubbed out.
The arbitrary baud interface has been working on darwin up to this point so it's
likely that it works properly. The GetBaudRate extension should still get
written to be thorough but for now, this will let the CI tests pass properly and
still throw a warning about the check being disabled.
That is, of course, if anyone's testing with the arduino hardware on darwin,
otherwise, these tests never run anyway.
- [osx] remove the 0x from productID and locationId and vendorId
- [linux] remove the starting 0x from any values, small refactor
- [linux] Fixup output using the hex encoded fields
- [windows] Grab the serial number from the pnp id
- Isolate list functions to their own platform files (c++)
- Better ensure our serialports fields are present
closes#1220
Drains don't make any sense if called on a closed port or before any writes. I'm queuing drains so they run one the port opens, just like `write()` this allows for a much easier time ensuring all data is written in a script.
- `drain()` waits for an open event if the port is closed
- mock-bindings now cancel pending reads
closes#1229
- [unix] small changes to flushing data during port open and setup to prevent bad data
- [all] mock binding flush now works
- cleanup on mock-binding pending reads
- add `serialport-repl` as a bin and npm command
This has always been the dream. Use `fs.read` and `fs.write` to do reading and writing. To make that happen I've created a cross platform `Poller` object that notifies us once on `readable` and `writable` states.
- Reduce large write cpu usage from 100% to 1-2%
- Replace ReadPoller with a multi purpose poller because you can only have a single uv_poll_t on a fd at a time because reasons
- Experimented with doing this all in c++, maybe there are gains to doing that but I'd never finish.
- Some unrelated eslint changes
- Arduino echo should just echo, writing random bytes was messing it up
- use a file to disable tests in envs
- read and write errors can trigger disconnects
- disconnect event only happens if there are listeners, otherwise error events will be triggered
- a disconnect during write will always have a write error too
- win32 bindings seem to only trigger disconnects on writes
* chore(package): update dependencies
* docs(readme): add Greenkeeper badge
* Ignore package-lock.json and fix linting
* Work around some issues with ci's
* fix windows coverage
* upgrade to non deprecated buffer methods
* Don't lint on node 4 as it's now broken
I really wish packages would keep things working on LTS platforms.