New:Socket for Asana Is Now Available.Learn more
Get Started

@fastify/autoload

Package Overview
Dependencies
Maintainers
19
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/autoload - npm Package Compare versions

Comparing version
6.1.0
to
6.2.0
+3
-1
.github/workflows/ci.yml

@@ -7,3 +7,2 @@ name: CI

- main
- master
- next

@@ -21,2 +20,5 @@ - 'v*'

test:
permissions:
contents: write
pull-requests: write
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5

@@ -23,0 +25,0 @@ with:

@@ -120,3 +120,3 @@ 'use strict'

runtime.tsimp ||
runtime.nodeVersion >= 23
runtime.supportNativeTypeScript
)

@@ -126,2 +126,11 @@ return cache.supportTypeScript

},
supportNativeTypeScript: {
get () {
cache.supportNativeTypeScript ??=
/* c8 ignore start - The right-hand part of the branch is unreachable on v20 for the moment */
process.features.typescript !== undefined && process.features.typescript !== false
/* c8 ignore end */
return cache.supportNativeTypeScript
}
},
forceESM: {

@@ -137,8 +146,2 @@ get () {

},
nodeVersion: {
get () {
cache.nodeVersion ??= Number(process.version.split('.')[0].slice(1))
return cache.nodeVersion
},
},
})

@@ -145,0 +148,0 @@

{
"name": "@fastify/autoload",
"version": "6.1.0",
"version": "6.2.0",
"description": "Require all plugins in a directory",

@@ -84,3 +84,3 @@ "main": "index.js",

"borp": "^0.19.0",
"esbuild": "^0.24.0",
"esbuild": "^0.25.0",
"esbuild-register": "^3.5.0",

@@ -101,3 +101,3 @@ "eslint": "^9.17.0",

"vite": "^6.0.2",
"vitest": "^2.0.3"
"vitest": "^3.0.4"
},

@@ -104,0 +104,0 @@ "jest": {

# @fastify/autoload
[![CI](https://github.com/fastify/fastify-autoload/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fastify-autoload/actions/workflows/ci.yml)
[![CI](https://github.com/fastify/fastify-autoload/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fastify-autoload/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/@fastify/autoload.svg?style=flat)](https://www.npmjs.com/package/@fastify/autoload)

@@ -5,0 +5,0 @@ [![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)

@@ -6,2 +6,6 @@ 'use strict'

if (runtime.supportNativeTypeScript) {
common()
}
function common () {

@@ -28,5 +32,1 @@ const args = ['node', 'test/typescript-common/index.ts']

}
if (runtime.nodeVersion >= 23) {
common()
}
'use strict'
const { exec } = require('node:child_process')
const runtime = require('../lib/runtime')
const nodeVersion = Number(process.version.split('.')[0].slice(1))
const args = [
'npx',
runtime.nodeVersion >= 18 ? '--node-options=--import=tsx' : '',
nodeVersion >= 18 ? '--node-options=--import=tsx' : '',
'tsnd',

@@ -10,0 +11,0 @@ 'test/typescript/basic.ts'

@@ -9,4 +9,2 @@ 'use strict'

const typeStrippingEnabled = runtime.nodeVersion >= 23
describe('independent module support - unexpected token', function () {

@@ -56,3 +54,3 @@ const app = Fastify()

it('should return cannot import plugin typescript error', async function () {
if (typeStrippingEnabled) {
if (runtime.supportNativeTypeScript) {
assert.doesNotThrow(() => app.ready())

@@ -59,0 +57,0 @@ } else {

@@ -27,3 +27,3 @@ 'use strict'

})
if (runtime.nodeVersion >= 23) {
if (runtime.supportNativeTypeScript) {
assert.doesNotThrow(() => app.ready())

@@ -30,0 +30,0 @@ } else {

'use script'
const t = require('tap')
const { test: t } = require('node:test')
const fastify = require('fastify')

@@ -5,0 +5,0 @@