Socket
Socket
Sign inDemoInstall

irc-prefix-parser

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irc-prefix-parser

IRC prefix parser


Version published
Weekly downloads
32
increased by23.08%
Maintainers
1
Weekly downloads
 
Created
Source

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
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'
 * }
 */

Keywords

FAQs

Package last updated on 01 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc