@caijs/console-connector

1.0.1 • Public • Published

@caijs/console-connector

Build Status Coverage Status NPM version NPM downloads

A console connector to build console based chatbots.

Installation

In your project folder run:

$ npm install @caijs/console-connector

Example of use

const ConsoleConnector = require('@caijs/console-connector');

function onHear(connector, input) {
  if (input.message.toLowerCase() === 'quit') {
    connector.destroy();
  } else {
    connector.say(input.message.split('').reverse().join(''));
  }
}

const connector = new ConsoleConnector({ onHear });
connector.initialize();
connector.say('Say something, I will reverse it! Say "quit" to end the conversation');

Dependents (0)

Package Sidebar

Install

npm i @caijs/console-connector

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.68 kB

Total Files

8

Last publish

Collaborators

  • jesus-seijas
  • jseijas