Recommend refactoring for less duplication and clearer intention:

```js
browser = (chrome && chrome.serial) ? 'browser-' : '',
SerialPort = require( browser + 'serialport').SerialPort;
```