@naxmefy/socket

1.3.0 • Public • Published

@naxmefy/socket

Installation

$ npm install @naxmefy/socket --save

Usage

For detailed usage, see Node.js documentation on net.Socket - https://nodejs.org/api/net.html#net_class_net_socket.

Quick example:

const Socket = require('@naxmefy/socket')
var socket = Socket.connect(1337, 'localhost')

socket.setEncoding('utf8')
socket.on('connect', function () {
	// connected

socket.end('hey')
	socket.destroy()
})

HINT: To prevent socket from reconnecting, use .destroy() method to completely close it.

Tests

$ npm test

License

MIT

/@naxmefy/socket/

    Package Sidebar

    Install

    npm i @naxmefy/socket

    Weekly Downloads

    0

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    5.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • naxmefy