Skip to content

Instantly share code, notes, and snippets.

@ahsquared
Forked from konsumer/index.html
Last active August 29, 2015 14:22
Show Gist options
  • Save ahsquared/f9a3a2b6d9c31de7666b to your computer and use it in GitHub Desktop.
Save ahsquared/f9a3a2b6d9c31de7666b 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