Skip to content

Commit 94989c1

Browse files
make-promises-safe is not needed in Node 15+ (fastify#3922)
1 parent 2ac0a66 commit 94989c1

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

docs/Guides/Getting-Started.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ fastify.listen({ port: 3000 }, function (err, address) {
5656

5757
Do you prefer to use `async/await`? Fastify supports it out-of-the-box.
5858

59-
*(We also suggest using
60-
[make-promises-safe](https://github.com/mcollina/make-promises-safe) to avoid
61-
file descriptor and memory leaks.)*
6259
```js
6360
// ESM
6461
import Fastify from 'fastify'
@@ -312,7 +309,7 @@ module.exports = fastifyPlugin(dbConnector)
312309
**our-first-route.js**
313310
```js
314311
/**
315-
* A plugin that provide encapsulated routes
312+
* A plugin that provide encapsulated routes
316313
* @param {FastifyInstance} fastify encapsulated fastify instance
317314
* @param {Object} options plugin options, refer to https://www.fastify.io/docs/latest/Reference/Plugins/#plugin-options
318315
*/
@@ -441,7 +438,7 @@ Schema](https://json-schema.org/).
441438

442439
Let's look at an example demonstrating validation for routes:
443440
```js
444-
/**
441+
/**
445442
* @type {import('fastify').RouteShorthandOptions}
446443
* @const
447444
*/
@@ -477,7 +474,7 @@ JSON bodies and serialize JSON output.
477474
To speed up JSON serialization (yes, it is slow!) use the `response` key of the
478475
schema option as shown in the following example:
479476
```js
480-
/**
477+
/**
481478
* @type {import('fastify').RouteShorthandOptions}
482479
* @const
483480
*/

docs/Reference/Errors.md

-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ way to deal with them is to
1717
[crash](https://nodejs.org/api/process.html#process_warning_using_uncaughtexception_correctly).
1818

1919
#### Catching Errors In Promises
20-
In Node.js, unhandled promise rejections (that is, without a `.catch()` handler)
21-
can also cause memory and file descriptor leaks. While `unhandledRejection` is
22-
deprecated in Node.js, unhandled rejections will not throw, and still
23-
potentially leak. You should use a module like
24-
[`make-promises-safe`](https://github.com/mcollina/make-promises-safe) to ensure
25-
unhandled rejections _always_ throw.
26-
2720
If you are using promises, you should attach a `.catch()` handler synchronously.
2821

2922
### Errors In Fastify

0 commit comments

Comments
 (0)