electron-node-red/README.md

91 wiersze
3.3 KiB
Markdown
Czysty Zwykły widok Historia

2016-03-09 21:59:34 +00:00
# electron-node-red
2016-03-09 21:49:41 +00:00
2016-05-06 12:18:15 +00:00
This is an Electron template to embed Node-RED with a Dashboard generated by node-red-dashboard.
This is not intended to be a useful tool as-is, but as a base for you to create your own versions. You will need to edit the `main.js` to suit your application and update the `package.json` file to include your own required dependencies.
At the top of `main.js` are a couple of flags you can switch to turn off editing, allow loading of a different flow file (and save as), and adding the worldmap to the menu. Again these are only there to show you possibilities. Have fun.
2016-03-09 21:49:41 +00:00
## To Use
To clone and run this repository you'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer. From your command line:
```bash
# Clone this repository
2016-10-29 13:43:32 +00:00
git clone https://github.com/dceejay/electron-node-red.git
2016-03-09 21:49:41 +00:00
# Go into the repository
2016-03-09 21:59:34 +00:00
cd electron-node-red
2016-03-09 21:49:41 +00:00
# Install dependencies and run the app
npm install && npm run clean && npm start
2016-03-09 21:49:41 +00:00
```
## TL:DR - building runtimes
2016-10-29 13:43:32 +00:00
On OSX you can run `./buildall` to build binaries of "everything"... maybe...
2016-10-29 13:43:32 +00:00
Run `npm run pack` to create packages for all platforms - these are the files required to run, they are not binary installers.
Builds are created in the `build` directory. Runtimes are created in the `../electron-bin` directory.
2016-10-29 13:43:32 +00:00
2016-11-01 08:54:10 +00:00
**Note**: this was written to work on a Mac... other tools may/will be needed on other platforms.
## Packaging your application
If you want to distribute executables of this project, the easiest way is to use electron-packager:
```
sudo npm install -g electron-packager
2016-10-30 22:06:48 +00:00
# build for OSX 64 bits
electron-packager . Node-RED --icon=nodered.icns --platform=darwin --arch=x64 --out=build --overwrite
2016-04-20 17:41:57 +00:00
# build for Windows 64 bits
2016-10-30 22:06:48 +00:00
electron-packager . Node-RED --icon=nodered.icns --platform=win32 --arch=x64 --out=build --asar=true --overwrite --win32metadata.CompanyName='IBM Corp.' --win32metadata.ProductName='Node-RED Electron'
2016-04-20 17:41:57 +00:00
# build for Linux 64 bits
2016-10-30 22:06:48 +00:00
electron-packager . Node-RED --icon=nodered.icns --platform=linux --arch=x64 --out=build --overwrite
```
2016-03-09 21:49:41 +00:00
Learn more about Electron and its API in the [documentation](http://electron.atom.io/docs/latest).
2016-05-06 12:18:15 +00:00
### To package as a dmg
2016-10-30 22:06:48 +00:00
`npm run build:osx`
2016-05-06 12:18:15 +00:00
look at `https://github.com/LinusU/node-appdmg`
2016-10-29 13:43:32 +00:00
sudo npm install -g appdmg
2016-05-06 12:18:15 +00:00
appdmg appdmg.json ~/Desktop/NodeRED.dmg
2016-05-10 11:39:24 +00:00
### To package as a deb
`npm run build:linux64` or `npm run build:linux32` - for Intel Linux
2016-10-30 22:06:48 +00:00
Look at `https://github.com/jordansissel/fpm`
2016-05-10 11:39:24 +00:00
2017-04-22 16:49:30 +00:00
fpm -s dir -t deb -f -n node-red-electron -v 0.16.2 -m your-email@example.com -a i386 Node-RED-linux-ia32/
fpm -s dir -t deb -f -n node-red-electron -v 0.16.2 -m your-email@example.com -a x86_64 Node-RED-linux-x64/
2016-05-10 11:39:24 +00:00
Use **sudo dpkg -i ...*** to install the correct deb for your architecture.
Use `Node-RED` command to run. Flows are stored in `~/.node-red`.
2016-05-10 11:39:24 +00:00
2016-10-30 22:06:48 +00:00
### To package as an exe
`npm run build:win32` - to build for 32-bit Windows.
`npm run build:win64` - to build for 64-bit Windows.
**Note**: This project was built to run on Mac OSX - To build for windows on other platforms you may need to use other tools.
2016-10-30 22:06:48 +00:00
## License [CC0 (Public Domain)](LICENSE.md)
2016-05-20 10:20:54 +00:00
## See also
- **Stand-alone Starter Project** - https://github.com/dceejay/node-red-project-starter
- **Bluemix Starter Project** - https://github.com/dceejay/node-red-bluemix-starter