@flexshopper/hapi-listeners
Standard NPM package with Flexshopper coding standards and guidelines.
Last updated 4 years ago by ar4mirez .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @flexshopper/hapi-listeners 
SYNC missed versions from official npm registry.

@flexshopper/hapi-listeners NPM version Build Status

Documentation

Getting started

How use it

  • Install hapi-listeners npm package in your project our plugin. npm i @flexshopper/hapi-listeners

Registering

manifest style:

registrations: [
    ...
    {
        plugin: {
            register: '@flexshopper/hapi-listeners',
            options: {
                dirname: '/lib/listeners'
            }
        }
    }
];

Listener structure:


module.exports = {
    name: 'eventName',
    method: (data) => {
        // any code that will execute when eventName is fired
    }
};

Just by creating a kraken event in any route handler


server.route({
    method: 'GET',
    path: '/route',
    handler: (request, reply) => {

        request.krakenEvent = {
            name: 'eventName',
            data: {}
        };
    }
})

Guidelines

License

© Flexshopper, LLC

Current Tags

  • 1.0.1                                ...           latest (4 years ago)

2 Versions

  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (5)
Dev Dependencies (18)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |