electron-nokogiri

0.0.12 • Public • Published

electron-nokogiri

  • in main
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
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)=>{
    
})
//...

Package Sidebar

Install

npm i electron-nokogiri

Weekly Downloads

1

Version

0.0.12

License

MIT

Last publish

Collaborators

  • foolishchow