@sz-md/node-tcp-server
v0.6.0
Published
A simple TCP Server module:
Downloads
2
Readme
@sz-md/node-tcp-server
A simple TCP Server module:
const NodeTCPServer = require("@sz-md/node-tcp-server")
const server = await NodeTCPServer.create({
port: 1337
})
server.on("connection", (client) => {
client.on("data", console.log)
client.write("Hello, World!\n")
client.close()
})
API
{ port, path, host = "0.0.0.0", backlog = 511 } // Options
.on("connection", connection) // connection is of type node-tcp-client