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

writes = new Space(); //Generate a place to store potential writes
writes.adhoc('hello\nworld') // A method to fill internal data with inline code.
writes.loc = [8, 16]; // Declares the location (in terms of characters displaced from the center)
main = new Socket('helloworld'); // Open socket at yourworldoftext.com/helloworld
main.on('open',()=>{ // When socket opens
  main.write(writes.towrite()); // Tell the server to write the content of `writes` to 
});