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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fatbot

v1.0.0

Published

An easy to use ES6 IRC bot framework

Downloads

25

Readme

    ______      __  ____        __
   / ____/___ _/ /_/ __ )____  / /_
  / /_  / __ `/ __/ __  / __ \/ __/
 / __/ / /_/ / /_/ /_/ / /_/ / /_  
/_/    \__,_/\__/_____/\____/\__/  

FatBot is an easy to use and extensible ES6 IRC bot framework.

Note: You are reading the documentation of the ES6 version (v1.x). If you are looking for the v0.3 documentation (coffeescript) please refer to the 0.3 branch.

Quick start

Install fatbot via npm

> npm install fatbot

Create a file bot.js

import { Bot } from 'fatbot'

let bot = new Bot({
  server: 'freenode',
  nick: 'fatbot',
  channels: ['#fatbot', '#skinnybot'],
  botDebug: false
})

// Listen to Bot events

bot.on('user:join', (r) => {
  r.reply "Welcome to #{r.channel}, #{r.nick} !"
})

// Listening discussion

bot.hear(/hello/, (r) => {
  r.reply(`Hello ${r.nick} !`)
})

// Connect the bot

bot.connect()

Launch the bot

> fatbot bot.js

In this example, you are :

  • Connecting mybot to a built-in server shortcut called freenode and join a channel called #fatbot
  • Perform action on events with Fatbot::on
  • Launching the bot with Fatbot::connnect method

Note: Since your bot will be launched with babel-node you can write your bot in ES6

Organize your Bot

For large bot projects, you may want to split your functionalities into different files.

You can use Bot::on with an object literal

bot.on({
  event: 'user:talk',
  trigger: (r) => {
    console.log(`${r.nick} is talking...`)
  }
})
// ./lib/hello.js
function callback (r) {
  r.reply(`Hello ${r.nick}!`)
}

export const ontalk = {
  event: 'user:talk',
  trigger: callback
}

export const onprivate = {
  event: 'user:private',
  trigger: callback
}
// ./bot.js
import * as hello from './lib/hello'

//...

bot.on(hello)

bot.connect()

Extending the Bot

You can extend the prototype of the Bot class. For example, the method Bot::hear is a built-in extension:

Bot.prototype.hear = function (regex,callback) {
  this.on('user:talk', (r) => {
    if (r.text.match(regex)) {
      callback(r)
    }
  })
}

Events

You can easily add behaviors to the bot by listening to events :

bot.on('user:join', (r) => {
  r.reply(`Welcome to ${r.channel}, ${r.nick}!`)
})

r is the Response object.

These are the events thrown by the bot.

Change log

2014-10-19 v-1.0.0*

  • Rewrite the project into ES6. Nothing has changed in the API

2013-03-17 v0.3.3

  • Fix CB when using coffee-script v.1.6.x compiler

2012-12-26 v0.3.2

  • You can now add event listeners with objects literal
  • You can now add event listeners bundled in arrays
  • README.md upadated with new examples

2012-12-26 v0.3.1

  • Bot completely rewritten (again)
  • Temporary removing sugars in favor of prototype extensions
  • Refinery lost in translation ;)
  • Simpler code to do such simple things

2012-12-24 v0.2.0

  • Bot completely rewritten in coffeescript on top of node and node-irc
  • Fatbot is now a standalone framework
  • Plugins are now called sugars
  • Added sugars factories called refinery helpers
  • Merge of node branch into master
  • Fist beta working version of the coffeescript version