@sz-md/node-tcp-socket
v0.4.0
Published
A simple TCP Socket module:
Downloads
3
Readme
@sz-md/node-tcp-socket
A simple TCP Socket module:
const NodeTCPSocket = require("@sz-md/node-tcp-socket")
const socket = await NodeTCPSocket.create({
host: "google.com",
port: 80
})
socket.on("data", (data) => {
console.log("Received", data.toString())
socket.close()
})
await socket.write("HEAD / HTTP/1.1\r\n\r\n")