# fastify-call

> fastify call self method

Latest version **2.0.2** (published 2019-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastify-call
pnpm add fastify-call
yarn add fastify-call
bun add fastify-call
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2019-09-23 |
| First published | 2019-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | huangang |
| Maintainers | huangang |
| Keywords | fastify, callself |

## Links

- npm: https://www.npmjs.com/package/fastify-call
- Repository: https://github.com/huangang/fastify-call
- Homepage: https://github.com/huangang/fastify-call#readme
- Issues: https://github.com/huangang/fastify-call/issues
- npm.io page: https://npm.io/package/fastify-call

## Dependencies (1)

- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^1.6.0

## Recent versions

- 2.0.2 (latest) — 2019-09-23
- 2.0.1 — 2019-09-23
- 2.0.0 — 2019-09-23
- 1.6.2 — 2019-09-23
- 1.6.1 — 2019-07-30
- 1.6.0 — 2019-07-29
- 1.5.2 — 2019-07-26
- 1.5.1 — 2019-07-26
- 1.5.0 — 2019-07-26
- 1.4.0 — 2019-07-24
- 1.3.0 — 2019-07-10
- 1.2.1 — 2019-07-09
- 1.2.0 — 2019-06-27
- 1.1.1 — 2019-06-19
- 1.1.0 — 2019-06-18
- … 9 more at https://npm.io/package/fastify-call/versions

## README

# fastify-call

Fastify plugin to call self method.

[![Build Status](https://travis-ci.org/huangang/fastify-call.svg?branch=master)](https://travis-ci.org/huangang/fastify-call)
[![NPM version](https://img.shields.io/npm/v/fastify-call.svg?style=flat)](https://www.npmjs.com/package/fastify-call)
## Install
```
npm i fastify-call --save
```
## Usage

```js
'use strict'

const fastify = require('fastify')()

fastify.register(require('fastify-call'))

fastify.get('/t1', function (request, reply) {
  reply.send({ 'hello': 't1' })
})

fastify.get('/t2', function (request, reply) {
  return fastify.call('t1').then((data) => {
    data.world = 't2'
    return reply.send(data)
  })
})

fastify.get('/t3', function (request, reply) {
  return fastify.call.post('t1', { a: 1 }).then((data) => {
    data.world = 't3'
    return reply.send(data)
  })
})

fastify.listen(3000, err => {
  if (err) throw err
  console.log(`server listening on ${fastify.server.address().port}`)
})
```

---
_Source: https://npm.io/package/fastify-call · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
