https://github.com/foolishchow/electron-nokogiri
light weight fetch and websocket defined by `electron ipcRender`
https://github.com/foolishchow/electron-nokogiri
Last synced: 12 months ago
JSON representation
light weight fetch and websocket defined by `electron ipcRender`
- Host: GitHub
- URL: https://github.com/foolishchow/electron-nokogiri
- Owner: foolishchow
- License: other
- Created: 2017-08-12T02:47:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-06T10:42:04.000Z (almost 9 years ago)
- Last Synced: 2025-05-31T00:48:50.561Z (about 1 year ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# electron-nokogiri
- in main
```javascript
const nokogiri = require("electron-nokogiri");
nokogiri.use('terminal/:pid', (next, params,param, event) => {
// params => your params
// param {pid:''}
// event => hook of ipcMain event
// next callback
//after done your things
next(result)
});
nokogiri.sockets('terminals/:pid',({socket,params}) => {
socket.send('hello electron');
socket.on('message', function(msg) {
});
socket.on('close', function() {
});
})
```
- in render
```javascript
const {fetcher,webSocket} = require("electron-nokogiri/lib/web");
fetcher('terminal/1111',params).then((data)=>{
console.info(data)
});
socket = new webSocket('terminals/11111');
socket.on('open',(data)=>{
})
//...
```