remote-run
v0.0.6
Published
run electron via remote script
Downloads
9
Readme
electron remote run
远程运行electron的代码
run main.js from remote url.
start demo
npm start
1. run main.js
const runRemote = require('remote-run');
runRemote.host = 'http://localhost:8080/bundles/';
//server root folder, used as the local project folder
//服务器目录,作为原项目的文件夹,把main.js preload.js 等文件放到这里即可
runRemote.main();
//runRemote.main('main.js');
console.log(global.RUN_REMOTE )
//是否从远程加载本项目
把项目的各种js文件都放到 runRemote.host 目录里
建议用webpack将项目的js都打包到一个文件内
2. fix preload.js
var preloadFilePath = runRemote.preload('preload.js');
// use this filepath as preload file
用preloadFilePath文件路径,替换以前设置preload的地方
其他
runRemote.run('abc.js');
//运行 call script: http://localhost:8080/bundles/abc.js
runRemote.runUrl('http://www.xxx.com/someone.js')
runRemote.getFile('abc.jpg');
//下载 http://localhost:8080/bundles/abc.jpg
runRemote.download('abc123.jpg', url);