GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - e-e-e/hyperchat: hypercore + chat

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
hyperchat.js
hyperchat.js
 
 
listener.js
listener.js
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 

Repository files navigation

Hyperchat

An experiment with using hypercore to share and record chat histories.

install

There are two options.

1. Globally

Install globally to use from the command line as a chat client:

npm install -g @e-e-e/hyperchat
hyperchat
# you will be promped to add a username
? What is your name? ...
# this will create a hypercore file in your home directory for this name
# from the chat interface you can enter any of the following commands
? >>>
# :h or :help - prints out the comments the chat cli accepts
# :w or :whoami - logs out your address
# :c [key] or :connect [key] - listens to conversation at key
# :d [key] or :disconnect [key] - stops listnening to conversation at key
# :q or :quit [key] - stops sharing and kills all connections

2. Package

Install and build your own chat app on top of hyperchat

npm install @e-e-e/hyperchat --save

and import in your project;

var hyperchat = require('@e-e-e/hyperchat')
var chat = new Hyperchat('username')

// you can listen to chat events
chat.on('ready', () => console.log(chat.name, 'now available on public key:', chat.key))
chat.on('connection', () => console.log('i am connected to someone'))
chat.on('listening', data => console.log('i am listening to', data.key))
chat.on('disconnecting', key => console.log('disconnecting from', key))
chat.on('disconnected', key => console.log('disconnected from', key))
chat.on('destroyed', () => console.log('Hyperchat is destroyed'))
chat.on('started', data => console.log(data.name, 'joined conversation'))
chat.on('ended', data => console.log(data.name, 'exited conversation'))
chat.on('heard', data => console.log(data.name, 'heard', data.who, '-', data.index))
chat.on('message', data => console.log(`${data.name}:`, data.message))

// connect to multiple other clients
chat.add('some-public-key')
chat.add('some-other-public-key')

// disconnect from other clients
chat.remove('some-public-key')

// and chat to any client who is also connected to you
chat.chat('hello world')

config

At the moment there are no config options exposed. Chats are by default stored at the users home: ~/hyperchats

About

hypercore + chat

Topics

chathypercorep2pp2p-chat

Resources

Readme
Activity

Stars

14 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.