Skip to content

Instantly share code, notes, and snippets.

@cuipengfei
Created December 14, 2013 05:52
Show Gist options
  • Save cuipengfei/7956077 to your computer and use it in GitHub Desktop.
Save cuipengfei/7956077 to your computer and use it in GitHub Desktop.
learn you node time server
var net = require('net')
var moment = require("moment")
var port = process.argv[2]
net.createServer(function (socket) {
socket.end(moment().format("YYYY-MM-DD HH:mm") + "\n")
}).listen(port)
@dwpenn
Copy link

dwpenn commented Jan 24, 2018

I'm going to show my naiveté, but they say it never hurts to ask. I see native code above, but I'm not sure of it's context; it's been that long....

Let's say I wanted the above or some other snippet to work with, what is the least expensive purchased or free code available to compile such statements into an EXE for the Windows platform?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment