Skip to content

chore(package): explicitly declare js module type#95

Merged
mcollina merged 1 commit into
mcollina:masterfrom
Fdawgs:patch-1
Mar 20, 2025
Merged

chore(package): explicitly declare js module type#95
mcollina merged 1 commit into
mcollina:masterfrom
Fdawgs:patch-1

Conversation

@Fdawgs

@Fdawgs Fdawgs commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

Node 21.1.0 added a flag to detect module types that became enabled by default in Node 22.7.0.
Declaring the type will cause Node to skip detection on startup, reducing startup time.

Declaring the package type is also considered good practice according to https://nodejs.org/api/modules.html#enabling.

As this is a dependency of avvio, which is a dependency of fastify, i'm just trying to shake as many yoctoseconds off of fastify's already fast startup as possible.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit d5b2db7 into mcollina:master Mar 20, 2025
@Fdawgs Fdawgs deleted the patch-1 branch March 20, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants