1.1.4 • Published 6 years ago

node-type-chat v1.1.4

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Node Type Chat

A simple test app making a p2p chat with node.js and typescript with chat in CLI.

Getting started

  • Clone or download the repository

  • Install dependencies

cd <project_name>
npm install
  • Build
npm build
  • Run
npm start

How to use

  1. When starting a peer first input a port number this peer will listen on.
port 1200
  1. Input a chatname for this peer
name JoeDoe
  1. Then connect to network again by specifying ip andport to connect to. For first peer, choose to connect to itself (no others to connect to yet)
connect 127.0.0.1 1200
  1. For second peer do the same, but when connecting choose the ip and port of first peer
port 1300
name IamSecondPeer
connect 127.0.0.1 1200
  1. For third or more peer(s) choose any ip and port of an existing peer.

How it works

Each peer functions both as a server and a client. A server/peer then offers methods which other peers can call:

  • Checkin to network for first time
  • Notify of new (chat) message
  • Notify of new peer(s)
  • Getting list of peers this peer has
  • Notify of peer changed (chat) name

The peer itself offers these methods, and also use them from other peers

Next up

Make an index.js which exports the functions so can be used as a module. The CLI interface should be possible to build with this module. Which also means some of the current output, like a message, shouldnt be outputted in the module, so I guess incoming messages or other stuff needs some listener interface, where the module user is notified and can react upon those events.

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago