# connection-parse

> Simple TCP connection string parser

Latest version **0.0.7** (published 2013-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install connection-parse
pnpm add connection-parse
yarn add connection-parse
bun add connection-parse
```

## 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.0.7 |
| Published | 2013-02-22 |
| First published | 2013-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Arnout Kazemier |
| Maintainers | V1 |
| Keywords | TCP, connection, parser, connection-string |

## Links

- npm: https://www.npmjs.com/package/connection-parse
- Repository: https://github.com/3rd-Eden/connection-parse
- npm.io page: https://npm.io/package/connection-parse

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2013-02-22
- 0.0.6 — 2013-02-22
- 0.0.5 — 2013-02-19
- 0.0.4 — 2013-02-19
- 0.0.3 — 2013-02-18
- 0.0.2 — 2013-02-15
- 0.0.1 — 2013-02-15
- 0.0.0 — 2013-02-09

## README

# connection-parse

Simple TCP connection string parser, and nothing more then that. It simply
transforms `1.1.1.1:1111` in to a simple parsed object. I seem to do this a lot
in most of my modules such as hashring, memcached and failover. So it makes
sense to extract this in to a small util.

## Installation

Install this module using `npm`:

```
npm install connection-parse --save
```

The `--save` automatically adds the package and version to your `package.json`.

## API

```js
var parse = require('connection-parse');

parse('1.1.1.1:1111')
parse('1.1.1.1:1111', '1.3.3.4:1345');
parse(['1.1.1.1:1111', '1.3.3.4:1345']);
parse({ '1.1.1.1:1111': 100 });

{
  servers: [{
    string: '1.1.1.1:1111',
    host: '1.1.1.1',
    port: 1111
  }],
  regular: ['1.1.1.1:1111'],
  weighted: {
    '1.1.1.1:1111': 100 // or 1 by default
  }
}

// It also accepts custom parsers
parse.merge(function (data) {
  data.foo = 'bar';
  return data;
});

Then the server instances will also have an extra property, `foo`.
```

## License

MIT

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