This package has been deprecated

Author message:

Deprecated because it suggests a wrong pattern

fastify-register-timeout

0.1.2 • Public • Published

fastify-register-timeout

Greenkeeper badge Build Status JavaScript Style Guide

Register fastify plugin with a timeout

NB: this plugin is going to DEPRECATED because it suggests a bad approach.

Install

npm i --save fastify-register-timeout

Usage

Registering this plugin

fastify.register(require('fastify-register-timeout'), {
  timeout: 5000 // ms
})

to use like this

fastfiy.registerWithTimeout(require('some-async-plugin'))

NB: in case of timeout, an exception is thrown with the function name as message. This is mean that the anonymous function should not be used here!

Why

There're two reason for this plugin:

  • in some case you need to know if your external dependencies are reachable before starting your server.
  • during the test, you need to know which plugin fails

Readme

Keywords

Package Sidebar

Install

npm i fastify-register-timeout

Weekly Downloads

6

Version

0.1.2

License

MIT

Unpacked Size

7.02 kB

Total Files

6

Last publish

Collaborators

  • allevo