Added docs to .hbs

This commit is contained in:
Andrew Chalkley 2016-10-16 19:06:07 -07:00
parent 55c39a1af3
commit 19b271007c
3 changed files with 19 additions and 2 deletions

View file

@ -54,6 +54,7 @@ For getting started with node-serialport, we recommend you begin with the follow
* [Command Line Tools](#command-line-tools)
* [Serial Port List](#serial-port-list)
* [Serial Port Terminal](#serial-port-terminal)
* [Building For Electron](#building-for-electron)
***
@ -330,3 +331,21 @@ $ serialport-term -l
/dev/cu.Bluetooth-Incoming-Port
/dev/cu.usbmodem1421 Arduino (www.arduino.cc)
```
## Building for Electron
Electron is a framework for creating cross-platform desktop applications. Electron comes with it's own version of the Node.js runtime.
If you require `serialport` as a depednancy for an Electron project you need to compile it for the version of Electron you're using in your project.
When you first install `serialport` it will compile against the version of Node.js on your machine, not against the Node.js runtime bundled with Electron.
To recompile `serialport` (or any native Node.js module) for Electron you can use `electron-rebuild`.
1. `npm install --save-dev electron-rebuild`
2. Delete existing Node.js binding `node_modules/serialport/build/Release/serialport.node`
3. Run `electron-rebuild`
1. For Windows `.\node_modules\.bin\electron-rebuild.cmd`
2. For Linux and macOS `./node_modules/.bin/electron-rebuild`
For more information on `electron-rebuild` visit the official [README](https://github.com/electron/electron-rebuild/blob/master/README.md).

1
.gitignore vendored
View file

@ -8,4 +8,3 @@ gyp-mac-tool
.node_pre_gyprc
/.idea
coverage
/.vscode

View file

@ -77,7 +77,6 @@ For getting started with node-serialport, we recommend you begin with the follow
* [Serial Port Terminal](#serial-port-terminal)
* [Building For Electron](#building-for-electron)
***
## Platform Support