Guest User

Untitled

a guest
Nov 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. ## example.js
  2.  
  3. var telnet = require('./lib/telnet')
  4. , client = telnet.createConnection(23, 'aardmud.org')
  5.  
  6. ## lib/telnet.js
  7.  
  8. var net = require('net')
  9.  
  10. exports.Client = require('./telnet/client')
  11.  
  12. exports.createConnection = function(port, host) {
  13. return new exports.Client(port, host)
  14. }
  15.  
  16. ## lib/telnet/client.js
  17.  
  18. var Client = module.exports = function(port, host) {
  19. var host = host || 'localhost'
  20.  
  21. console.log('Connecting to ' + host + ':' + port)
  22. }
Add Comment
Please, Sign In to add comment