aboutsummaryrefslogtreecommitdiff
path: root/examples/helloworld.js
blob: cc43666c374f332a559e7b3b93fd304dc23f3b24 (plain)
1
2
3
4
5
6
7
8
9
10
const ywot = require('../socket'); // Import direct library
const space = require('../space');

writes = new space.Space(); //Generate a place to store potential writes
writes.adhoc('hello\nworld') // A method to fill internal data with inline code.
main = new ywot.Socket(''); // Open socket
main.on('open',()=>{ // When socket opens
  main.write(writes.towrite([8,16])); // Tell the server to write the content of `writes` to 
});