0.0.9 • Published 7 years ago

atom-socket v0.0.9

Weekly downloads
3
License
MIT
Repository
-
Last release
7 years ago

AtomSocket

Share websockets in Atom Packages.

How It Works

AtomSocket uses Atom's localStorage API (via page-bus) to share websocket connections in Atom packages across render processes.

Install

npm install atom-socket --save

Usage

const AtomSocket = require('atom-socket')

const socket = new AtomSocket('term', 'wss://ide.learn.co:443/terminal')

socket.on('error', (err) => {
  console.error(err)
})

socket.on('open', () => {
  console.log('Client Connected')
})

socket.on('close', () => {
  console.log('Client Closed')
})

socket.on('message', (msg) => {
  console.log(msg)
})

socket.on('open:cached', () => {
  console.log('Client Connected through Existing WebSocket')
})

socket.send('hello world')

socket.close()

socket.reset()

License

MIT Licensed

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago