Skip to content

Instantly share code, notes, and snippets.

@konsumer
Last active August 29, 2015 14:11
Show Gist options
  • Save konsumer/a1c5c8471a51d9077ca0 to your computer and use it in GitHub Desktop.
Save konsumer/a1c5c8471a51d9077ca0 to your computer and use it in GitHub Desktop.
Your serial ports:
<ul id="ports"></ul>
<script>
require('serialport').list(function(err, ports){
document.getElementById('ports').innerHTML = ports.map(function(port){
return '<li>' + port.comName + '</li>';
}).join('');
});
</script>
{
"name": "nwktest",
"version": "1.0.0",
"devDependencies": {
"node-webkit-builder": "^0.4.0"
},
"main": "index.html",
"scripts": {
"start": "nwbuild -r ."
},
"dependencies": {
"serialport": "^1.4.6"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment