node-packet-header This can help to make packet header and body for communication between client and server easilly. Example var packetTool = require('node-packet-header'); var PacketHeader = new packetTool.Header(); var PacketTypes = packetTool.HeaderTypes;