npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

slack-irc-client

v0.3.3

Published

Use Slack as your IRC client

Downloads

15

Readme

Maintainer needed, see #33

Slack IRC client

Build Status NPM Version

Work in progress. Proceed with caution. Testers and contributions are welcome.

Slack IRC client is a node.js application that acts as an IRC client as well as a Slack client, bridging communication between the two networks for a single user.

It differs from the splendid ekmartin/slack-irc gateway in that instead of syncing messages for all users on a single channel, slack-irc-client syncs all messages for a single user on all channels.

Features

  • Chat on any IRC channel form your favorite Slack client
  • Send and receive IRC queries
  • Channel topics are synced both ways
  • Status messages delivered to Slackbot DM chat
  • Configured through Slack user and channel metadata

Instructions

Installation

  1. Create new Slack team at https://slack.com/create

    • Don't invite anyone else to the team
    • Adding multiple users will lead to duplicate messages being sent to IRC
  2. Remove the default channels, create and join the Slack channels you want to join in IRC

  3. Set configuration in your user profile "What I do field" at https://slack.com/account/profile

    • JSON formatted string with the following fields

      • server: IRC server to connect to
      • port: Port to connect to (defaults to 6668)
    • All fields will be passed to node-irc

    • For example:

      {
        "server": "open.ircnet.net",
        "port": 6668,
        "userName": "aeirola"
      }
    • Optionally, a string field nsPassword will cause the bot to send /msg Nickserv IDENTIFY ${nsPassword} after 5 seconds of being connected which is the correct format for freenode's nickserv. Other nickservs may not like this format, but it's a start.

  4. Generate a Test token for your newly created team at http://aeirola.github.io/slack-irc-client/

  5. Install slack-irc-client from npm

    npm install -g slack-irc-client
  6. Start the gateway with

    slack-irc-client -t ${SLACK_API_TOKEN}
  7. Chat from your Slack!

Upgrade

  1. Update the npm package:

    npm update -g slack-irc-client
  2. Reload the code by entering the command reload in the terminal running the application

Usage

Once everything is set up, normal usage of IRC through Slack should be pretty straightforward chatting. Messages are sent and received, topics are synced and so forth. Here are some special cases that might need additional instructions though.

Joining channels

Normal channels with names that adhere to Slacks channel naming convention (max 21 chars, alphanumerics underscore or dash) can be joined by just creating the channel in Slack. Leave out the preceding # in the name.

If you need to join other types of channels, you need to add a channel configuration in the channel "Purpose" field. The value of this field should be a JSON formatted string containing the following fields:

  • channelName: The IRC channel name to use

For example:

{
  "channelName": "!CUCREslack-irc-client"
}

Warning: Due to an issue in how Slack updates the channel purpose only after channel creation, the plain channel name will be joined in IRC on first creation of the channel. You need to leave this channel in Slack and join it again to join the correct IRC channel.

This can also be used if you just want the channel name to show differently within Slack.

Ignoring JOIN, PART, QUIT, etc.

To ignore various messages, you can configure your What I do JSON object to include the muteIrcEvents field:

{
  "server": "open.ircnet.net",
  // ...
  "muteIrcEvents": ["join", ...]
}

And you'll no longer see these messages in your Slack channels.

Valid values for this field are as follows:

| Value | Description | | ------- | ----------------------------------------------- | | join | Mute JOIN messages in the channel | | kick | Mute KICK messages in the channel | | kill | Mute KILL messages in the channel | | motd | Mute MOTD direct messages from slackbot on join | | names | Mute membership list in the channel on join | | part | Mute PART messages in the channel | | quit | Mute QUIT messages in the channel | | topic | Don't set the topic in the channel on join |

Sending direct messages

If an IRC users sends you a direct message, a new Slack group chat will be created for your 1-to-1 chat with the IRC user. No action is needed on your part.

If you want to initiate a 1-to-1 chat with an IRC user that has not yet sent you an message, you need to create a new Slack group chat with the nick of the IRC user you want to contact.

Additional IRC options

Since the What I do field is directly parsed into a JSON object, you can supply additional commands, listed at the node-irc API documentation. For example, if you want to connect with SASL, which you might need to from an AWS server to Freenode, your configuration could look like the following,

{
     "server": "irc.freenode.net", 
     "port": 6697, 
     "userName": "NICKNAME", 
     "nsPassword": "PASSWORD", 
     "sasl": true, 
     "nick": "NICKNAME",
     "password": "PASSWORD", 
     "realName": "MY REAL NAME", 
     "secure": true 
}

Which will set sasl to true, along with enabling SSL. Of course you need to replace the placeholders above with your own settings.

Terminal commands

help

Prints list of supported commands.

reload

Reloads event handler code for upgrading without breaking network connections.

loglevel <loglevel>

Set terminal output log level. Supported log levels are:

  • silly
  • debug
  • verbose
  • info