open-index/open-npm huggingface dataset:
npm package: @ocalan/graceful
Description: Gracefully exit server (Koa), database (Mongo/Mongoose), Bree job schedulers, Bull job schedulers, and custom handlers.
Author: Nicholai Nissen
Latest version: 1.1.0
Deprecated: Use @ladjs/graceful. All features up to 1.1.0 has been merged upstream.

# [**@ocalan/graceful**](https://github.com/ocalan/graceful)

> Gracefully exit server (Koa), database (Mongo/Mongoose), Redis clients, Bree job schedulers, Bull job schedulers, and custom handlers.

> Forked from [@ladjs/graceful](https://github.com/ladjs/graceful) to add TypeScript definitions.


## Table of Contents

* [Install](#install)
* [Usage](#usage)
* [Contributors](#contributors)
* [License](#license)


## Install

[npm][]:

```sh
npm install @ocalan/graceful
```

[yarn][]:

```sh
yarn add @ocalan/graceful
```


## Usage

Using this package will bind process event listeners when `graceful.listen()` is called:

* `process.on('warning')` - will output via `config.logger.warn`
* `process.on('unhandledRejection')` - will output via `config.logger.error`
* `process.once('uncaughtException')` - will output via `config.logger.error` and `process.exit(1)` (*does not exit gracefully*)
* `process.on('message')` - support Windows (e.g. signals not available) and listen for message of `shutdown` and then exit gracefully
* `process.once('SIGTERM')` - will exit gracefully
* `process.once('SIGHUP')` - will exit gracefully
* `process.once('SIGINT')` - will exit gracefully
* `process.once('SIGUSR2')` - will exit gracefully (nodemon support)

This package also prevents multiple process/SIG events from triggering multiple graceful exits. Only one graceful exit can occur at a time.

See one of these following files from [Lad][] for the most up to date usage example:

* API - <https://github.com/ladjs/lad/blob/master/template/api.js>
* Web - <https://github.com/ladjs/lad/blob/master/template/web.js>
* Bull - <https://github.com/ladjs/lad/blob/master/template/bull.js>
* Proxy - <https://github.com/ladjs/lad/blob/master/template/proxy.js>

You can also read more about Bree at <https://github.com/breejs/bree>.


## Contributors

| Name                | Website                        |
| ------------------- | ------------------------------ |
| **Nick Baugh**      | <http://niftylettuce.com/>     |
| **Felix Mosheev**   | <https://github.com/felixmosh> |
| **Nicholai Nissen** | <https://nicholai.dev>         |


## License

[MIT](LICENSE) © [Nicholai Nissen](https://nicholai.dev)


##

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

[lad]: https://lad.js.org
npm package: @ocalan/problem
Description: A middleware for converting errors into application/problem+json
Author: Evert Pot
Latest version: 0.3.1

Curveball Problem Middleware
===========================

### **NOTE**: Published with updated typings, forked from [the original module][4]. This version will deprecate once merged.
\
This package is a middleware for the [Curveball][2] framework that catches any
exception and turns them into `application/problem+json` responses, as defined
in [RFC7807][1].

By default any exception turns into a non-descript 500 Internal Server Error.
To create a more specific error, use an exception from the
[@curveball/http-errors][3] package or implement one of the interfaces.

Installation
------------

    npm install @ocalan/problem


Getting started
---------------

```typescript
import problemMw from '@ocalan/problem';
import { Application } from '@curveball/core';

const app = new Application();
app.use(problemMw());
```

Typically you will want the problem middleware to be one of the first
middlewares you add to the server. Only exceptions from midddlewares that come
after the problem middleware can be caught.


### Throwing errors

You can throw the following kinds of errors.

* Standard errors. These errors will be anonimized and logged to the console.
  a http 500 error gets emitted. (unless debug mode is on).
* Errors with a `httpStatus` property. Any error that's thrown that has a
  `httpStatus` property will automatically use that http status. The error
  message will be used as a title.
* An error from the [http-errors][3] package.


### Debug mode

By default the middleware will emit a detailed error for any exception that
implements the [http-errors][3] interfaces, because the assumption is that
if these errors were emitted, they were intended for the user of the server.

Any exceptions that are thrown that don't implement these interfaces are
stripped from their message and detail and converted to a 500 error to avoid
potential security issues.

It's possible to turn this off during development in two ways. You can set
the debug setting to true as such:

```typescript
app.use(problemMw({
  debug: true
});
```

The second way is by setting the environemnt variable `NODE_ENV` to the string
`development`.

If the `debug` property is set, that value always takes precedent.

### Quiet mode

If quiet mode is enabled, 4XX errors are not logged. Client errors are common
and usually expected behavior, so it might be preferable for them to not spam
the log.

```typescript
app.use(problemMw({
  quiet: true
});
```


[1]: https://tools.ietf.org/html/rfc7807
[2]: https://github.com/curveball/
[3]: https://github.com/curveball/http-errors
[4]: https://github.com/curveball/problem
npm package: @ocallarob/schematics
Description: Nest - modern, fast, powerful node.js web framework (@schematics)
Latest version: 9.0.11

<p align="center">
  <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
</p>

  <p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
    <p align="center">
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/schematics.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/schematics.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/schematics.svg" alt="NPM Downloads" /></a>
  <a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
  <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
  <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>

## Description

The Nest CLI is a command-line interface tool that helps you to initialize, develop, and maintain your Nest applications. It assists in multiple ways, including scaffolding the project, serving it in development mode, and building and bundling the application for production distribution. It embodies best-practice architectural patterns to encourage well-structured apps. Read more [here](https://docs.nestjs.com/cli/overview).

## Installation

```bash
$ npm install -g @nestjs/schematics
```

## Usage

Learn more in the [official documentation](https://docs.nestjs.com/).

## Stay in touch

- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).