Skip to content

Commit

Permalink
types: use node: prefix for builtins (#336)
Browse files Browse the repository at this point in the history
* types: use `node:` prefix for builtins

* perf: use `node:` prefix to bypass require.cache call for builtins

* build(deps-dev): bump neostandard
  • Loading branch information
Fdawgs authored Dec 15, 2024
1 parent 5fe4109 commit 0a323fe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Note that the compress method is configured with either the per route parameters
the plugin was defined as global.
```javascript
import fs from 'fs'
import fs from 'node:fs'
import fastify from 'fastify'

const app = fastify()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"c8": "^10.1.2",
"fastify": "^5.0.0",
"jsonstream": "^1.0.3",
"neostandard": "^0.11.9",
"neostandard": "^0.12.0",
"tsd": "^0.31.0",
"typescript": "~5.7.2"
},
Expand Down
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
RawServerBase,
RawServerDefault
} from 'fastify'
import { Stream } from 'stream'
import { BrotliOptions, ZlibOptions } from 'zlib'
import { Stream } from 'node:stream'
import { BrotliOptions, ZlibOptions } from 'node:zlib'

declare module 'fastify' {
export interface FastifyContextConfig {
Expand Down
4 changes: 2 additions & 2 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fastify, { FastifyInstance } from 'fastify'
import { createReadStream } from 'fs'
import { createReadStream } from 'node:fs'
import { expectError, expectType } from 'tsd'
import * as zlib from 'zlib'
import * as zlib from 'node:zlib'
import fastifyCompress, { FastifyCompressOptions } from '..'

const stream = createReadStream('./package.json')
Expand Down

0 comments on commit 0a323fe

Please sign in to comment.