Created
December 14, 2013 05:52
-
-
Save cuipengfei/7956077 to your computer and use it in GitHub Desktop.
learn you node time server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?