# tcp.js

> Easy TCP communication for node.js

Latest version **0.1.2** (published 2012-10-16) · 0 weekly downloads

## Install

```sh
npm install tcp.js
pnpm add tcp.js
yarn add tcp.js
bun add tcp.js
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2012-10-16 |
| First published | 2012-10-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kasper Rasmussen |
| Maintainers | kasmura |
| Keywords | tcp, socket, realtime, communication |

## Links

- npm: https://www.npmjs.com/package/tcp.js
- Repository: https://github.com/kasmura/tcp.js
- npm.io page: https://npm.io/package/tcp.js

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) 1.4.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2012-10-16
- 0.1.1 — 2012-10-07
- 0.1.0 — 2012-10-07

## README

# tcp.js

tcp.js is a Node.js project making TCP communication easy in node.js. It tries to level out the difference between and a client, making the communication more simple. It also has built-in JSON encoding/decoding.

## How to Install

```bash
$ npm install tcp.js
```

## How to use

### Server

```js
var sockets = require('tcp.js').server(1337);

sockets.on('connection', function (socket) {
  socket.send('news', { hello: 'world'});
  socket.on('myEvent', function (data) {
    console.log(data);
  });
});
```

### Client

```js
var sockets = require('tcp.js').client('127.0.0.1', 1337);

sockets.on('connection', function(socket) {
  socket.on('news', function (data) {
    console.log(data);
    socket.send('myEvent', { my: 'data'});
  });    
});
```

## Author
This library is developed by kasmura

His website is www.kasmura.com

## (un)License
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>

---
_Source: https://npm.io/package/tcp.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
