2.2.0 • Published 9 months ago

@aegenet/belt-fastify-abort v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

npm version

@aegenet/belt-fastify-abort

Auto add an AbortController on all Fastify Request

Node only!

💾 Installation

yarn add @aegenet/belt-fastify-abort@^2.0.0
# or
npm i @aegenet/belt-fastify-abort@^2.0.0

📝 Usage

Node.js

import { fastifyAbortRegister, type FastifyRequestAbortCtrl } from '@aegenet/belt-fastify-abort';
import fastify from 'fastify';

const app = fastify();
// register the fastify abort
fastifyAbortRegister(app);

fastify.post('/api/random', async (request: FastifyRequestAbortCtrl, reply) => {
  // AbortController is available in abortCtrl
  assert.ok(request.abortCtrl);

  /** your code */
  reply.code(200).send({});
});
2.2.0

9 months ago

2.1.0

11 months ago

1.6.2

12 months ago

1.7.0

12 months ago

2.0.0

12 months ago

1.5.0

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.2

1 year ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago