# irc-prefix-parser

> IRC prefix parser

Latest version **1.0.1** (published 2015-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install irc-prefix-parser
pnpm add irc-prefix-parser
yarn add irc-prefix-parser
bun add irc-prefix-parser
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-03-01 |
| First published | 2015-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Fionn Kelleher |
| Maintainers | expr |
| Keywords | irc, prefix, parser |

## Links

- npm: https://www.npmjs.com/package/irc-prefix-parser
- Repository: https://github.com/expr/irc-prefix-parser
- Issues: https://github.com/expr/irc-prefix-parser/issues
- npm.io page: https://npm.io/package/irc-prefix-parser

## 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

- 1.0.1 (latest) — 2015-03-01
- 1.0.0 — 2015-02-21

## README

# irc-prefix-parser
> Parse IRC message prefixes

## Installation

    npm install irc-prefix-parser

## Usage

The parser takes a string and returns an object with:

* `raw` - original prefix
* `isServer` - boolean indicating whether or not the prefix is a server. If `false`, the prefix is a user.
* `nick`, `user` and `host`

```js
var parse = require('irc-prefix-parser')

console.log(parse('foobar.freenode.net'))
/* {
 *   raw: 'foobar.freenode.net',
 *   isServer: true,
 *   nick: null
 *   user: null
 *   host: 'foobar.freenode.net'
 * }
 */

console.log(parse('jamie!weechat@127.0.0.1'))
/* {
 *   raw: 'jamie!weechat@127.0.0.1',
 *   isServer: false,
 *   nick: 'jamie',
 *   user: 'weechat',
 *   host: '127.0.0.1'
 * }
 */
```

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