Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Example usage

Basic usage

This example uses the two files in the examples/basic directory.

First run the announce.js file in the terminal to announce a service:

node examples/basic/announce.js

Then run the lookup.js file in another terminal tab or window:

node examples/basic/lookup.js

Usage with net.createServer

This example uses the two files in the examples/net directory.

Run the announce.js file in the terminal to announce the server:

node examples/net/announce.js

Then run the lookup.js file in another terminal tab or window:

node examples/net/lookup.js

Usage with hypercore

This example uses the two files in the examples/hypercore directory.

Run the announce.js file in the terminal to announce the server:

node examples/hypercore/announce.js

Then run the lookup.js file in another terminal tab or window:

You can copy this command with the key from the output of running the announce.js file.

node examples/hypercore/lookup.js <key>