@dibot/service

1.1.0 • Public • Published

@dibot/service

@dibot/service is a nodejs package that contain a simple interface call Service.

This interface is used by @dibot/dibot to manage various services.

How to create a service

import Service from '@dibot/service';

export default class MyService extends Service {
    
    //MUST ALWAYS HAVE 'dibot' HAS FIRST PARAMETER
    constructor(dibot) {
        //The name will be used to manage the service in Dibot;
        super('my_service_name', dibot); 
    }
    
    start() {
        //This method is called automatically by dibot's main process
        //YOu may start you service here
    }
    
    stop() {
        //Put here the code to properly stop your service
    }
}

Building from source

Clone this repo , then from a command line

npm install #or yarn
npm run build #or yarn build

Readme

Keywords

none

Package Sidebar

Install

npm i @dibot/service

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

204 kB

Total Files

76

Last publish

Collaborators

  • shalien