open-index/open-npm huggingface dataset:
npm package: @kit-p/fastify-tasks
Description: Tasks tracking plugin for Fastify
Author: Kit PANG
Latest version: 2.0.0

# @kit-p/fastify-tasks

![CI](https://github.com/Kit-p/fastify-tasks/workflows/CI/badge.svg)
[![NPM version](https://img.shields.io/npm/v/@kit-p/fastify-tasks.svg?style=flat)](https://www.npmjs.com/package/@kit-p/fastify-tasks)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

Add task tracking support for Fastify. The server will not close until all tasks are completed.

`@kit-p/fastify-tasks` decorates the server interface with the `tasks.add` and `tasks.remove` methods for tracking tasks.

## Install

```
npm i @kit-p/fastify-tasks
```

<a name="quickstart"></a>

## Quick start

`fastify.register` is used to register @kit-p/fastify-tasks. By default, It will decorate the `fastify` object with `tasks.add` and `tasks.remove` methods that take an optional argument:

- the name of the task (does not need to be unqiue)

```js
// index.js:
const fastify = require("fastify")()
const fastifyTasks = require("@kit-p/fastify-tasks")

fastify.register(fastifyTasks)

// named task:
fastify.get("/", (req, reply) => {
  fastify.tasks.add('some-task')
  reply.send('')
  // do some work
  fastify.tasks.remove('some-task')
})

// unnamed task:
fastify.get("/", (req, reply) => {
  fastify.tasks.add()
  reply.send('')
  // do some work
  fastify.tasks.remove()
})

fastify.listen({ port: 3000 }, (err) => {
  if (err) throw err;
  console.log(`server listening on ${fastify.server.address().port}`);
})
```
npm package: @kit-p/json-kit
Description: JSON Toolkit for (de)serialization | (un)minification | (de)compression
Author: Kit PANG
Latest version: 2.0.0

<h1 align="center">json-kit</h1>

<div align="center">
  <a href="https://www.npmjs.com/package/@kit-p/json-kit">
    <img
      src="https://img.shields.io/npm/v/%40kit-p/json-kit"
      alt="npm: @kit-p/json-kit"
    />
  </a>
  <a>
    <img
      src="https://img.shields.io/github/languages/top/Kit-p/json-kit"
      alt="languages: github.com/Kit-p/json-kit"
    />
  </a>
  <a href="https://github.com/semantic-release/semantic-release">
    <img
      src="https://img.shields.io/badge/semantic--release-conventionalcommits-e10079?logo=semantic-release"
      alt="semantic-release: conventionalcommits"
    />
  </a>
  <a href="https://gitpod.io/#https://github.com/Kit-p/json-kit">
    <img
      src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
      alt="Contribute with Gitpod"
    />
  </a>
</div>

<h3 align="center">JSON Toolkit for (de)serialization | (un)minification | (de)compression</h3>

---

## Project State

> This project is in **maintenance** state. The APIs are stable.

## Installation

### For Node.js:

- `npm install @kit-p/json-kit`
- `yarn add @kit-p/json-kit`
- `pnpm add @kit-p/json-kit`

#### _CommonJS_

```js
const { JsonKit } = require("@kit-p/json-kit");
```

#### _ESM_

```js
import { JsonKit } from "@kit-p/json-kit";
```

### For browsers:

#### _CommonJS_

- ```html
  <script src="https://cdn.jsdelivr.net/npm/@kit-p/json-kit"></script>
  <script>
    console.log(JsonKit);
  </script>
  ```
- ```html
  <script src="https://unpkg.com/@kit-p/json-kit"></script>
  <script>
    console.log(JsonKit);
  </script>
  ```

#### _ESM_

- ```html
  <script type="module">
    import { JsonKit } from "https://cdn.jsdelivr.net/npm/@kit-p/json-kit/+esm";
  </script>
  ```
- ```html
  <script type="module">
    import { JsonKit } from "https://unpkg.com/@kit-p/json-kit?module";
  </script>
  ```

## Usage

See [the documentation site](https://kit-p.github.io/json-kit/modules.html) or [the repository Wiki page](https://github.com/Kit-p/json-kit/wiki/Exports) or `docs/modules.md`.

## License

[MIT](https://github.com/Kit-p/json-kit/blob/main/LICENSE)