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

ebony-framework

v3.1.1

Published

A module-based NodeJS chatbot framework.

Downloads

84

Readme

Ebony Framework

npm Node CI

An easy to use, module-based, multi-channel chatbot framework.

Features

  • Separation in independent, portable, easy to customize modules
  • Separate adapters for interfacing with communication channels (Facebook Messenger, Slack, Viber, SMS etc.)
  • Dialogue context management system
  • Route-based rules, with middlewares
  • Uses MongoDB for storing user information

Getting Started

For now, there is no detailed documentation for Ebony Framework. You can easily create an ebony-based Facebook Messenger Bot with the Messenger Bot Template. If you have any questions and/or suggestions feel free to open an issue, or create a pull request.

Prerequisites

You'll need to have NodeJS/NPM on your system, as well as Typescript installed either in your node_modules folder or globally in your system.

Install Ebony Framework

$ npm i ebony-framework

Install an adapter

(For now only a Messenger Platform adapter is available)

$ npm i ebony-messenger-adapter

Initialize the bot

import { Bot } from 'ebony-framework';

// Import the adapter (for example the Messenger Adapter) as well as the user model
import { MessengerAdapter, MessengerUser } from 'ebony-messenger-adapter';

// ... Here import the modules you'll use...
import botModule from './modules/botModule';

const adapters = [
    // Here you initialize the adapters one by one.
    // For example the Messenger Adapter:
    new MessengerAdapter({
        pageId: /* Your FB Page ID */,
        pageToken: /* Your Page Token */ ,
        appSecret: /* Your App Secret */,
        webhookKey: /* Your Webhook Key */
    });
];

export const bot = new Bot<MessengerUser>(adapters, {
    mongodbUri: /* Your MongoDB Connection URI */
});

bot.addModule(botModule);

bot.start({
    port: 3000 // You can substitute "3000" with the PORT of your choice.
});

Channel Adapters

For now, only a Messenger Platform adapter is publicly available. If you want to use the Ebony Framework for another channel, open an issue to discuss the development of a new adapter.

Modules

A module is a portable collection of actions, rules and middlewares that is imported into the chatbot on runtime.

See Modules.md for more information.

Action

An action is a function that when triggered, sends a message to the user.

Rules

There are multiple types of rules inside a module. A rule could be context based (ContextRouter), postback based (PostbackRouter) or even a regex (TextMatcher). These rules, work similarly to routes in a web framework. They point to an action that is triggered when the rule is satisfied.

Middlewares

Middlewares run before (preMiddlewares) and after (postMiddlewares) an action is triggered.

Next Steps

  • Use redis for user context storing
  • Decouple database logic from framework (add support for multiple databases)
  • Create Slack Adapter
  • Add support for multiple adapters per bot (Allow the same bot to answer through many channels)
  • Refine the User model, support true extendable user models
  • Add tests

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.