# echos

> A simple echo server and client.

Latest version **0.1.0** (published 2014-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install echos
pnpm add echos
yarn add echos
bun add echos
```

Provides the commands `echos`, `echos-client`, `echos-server`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-01-05 |
| First published | 2014-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Rafael Corral |
| Maintainers | rcorral |
| Keywords | echo, echo server, echo client |

## Links

- npm: https://www.npmjs.com/package/echos
- Repository: https://github.com/rcorral/node-echos
- Issues: https://github.com/rcorral/node-echos/issues
- npm.io page: https://npm.io/package/echos

## Dependencies (1)

- [optimist](https://npm.io/package/optimist.md) ~0.6.0

## Recent versions

- 0.1.0 (latest) — 2014-01-05
- 0.0.1 — 2014-01-05

## README

echos [![Build Status](https://secure.travis-ci.org/rcorral/node-echos.png)](http://travis-ci.org/rcorral/node-echos)
=====

Echos is a simple echo server and client. More specifically, echos allows you to setup an echo server that will replay any text sent to it.
Echos also comes with a client that allows you to send an echo request to a server, and it will print it back.

Installation
============
####Local
``` bash
$ npm install echos
```

####Global
``` bash
$ npm install -g echos
```

Usage – Command line
====================

Server
------

    Usage: ./echos server -p,--port <port> -q,--quiet
    Usage: ./echos-server -p,--port <port> -q,--quiet

    Options:
      -p, --port   [default: 1024]
      -q, --quiet  [default: false]

Client
------
    Usage: ./echos client message -p,--port <port> -h,--host <host>
    Usage: ./echos-client message -p,--port <port> -h,--host <host>

    Options:
      -p, --port       [default: 1024]
      -h, --host       [default: "127.0.0.1"]
      -t, --timestamp  [default: false]

Example
-------

Running the server on port ``1337``  
``` bash
$ ./bin/echos server -p 1337
```

Run the client to connect to the server on port ``1337`` and send ``Hello World!``  
``` bash
$ ./bin/echos client Hello World! -p 1337 -t
```

When the server receives an echo request from the client it will log out something like this:  
```
Echo message received:
    Hello World!
    From address: 127.0.0.1
    Time: Sat Jan 04 2014
```

After the client receives the echo response from the server it will log out something like this:  
```
Hello World! time=7ms
```

Usage – As a module
===================

Initialize
----------
``` js
var echos = require('echos');
```

Create server
-------------
``` js
echos.server.start({port: 1337, quiet: false, callback: function(data){}});
```

Send echo from client
---------------------
``` js
echos.client.echo('Hello World!', {port: 1337, timestamp: true, callback: function(data){}});
```

Run in development
==================

Requirements
------------
1. Install node and npm
2. Install grunt-cli - http://gruntjs.com/getting-started

Install package requirements
----------------------------
1. Run ``npm install`` in the root of the repo

Watch for file changes, run grunt from the root of the repo. This will lint and run tests.  
``` bash
$ grunt watch
```

Run Tests
=========
``` bash
$ npm test
```

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