Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use node: prefix for builtins #270

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use strict'

const zlib = require('node:zlib')
const { inherits, format } = require('node:util')

const fp = require('fastify-plugin')
const zlib = require('zlib')
const encodingNegotiator = require('@fastify/accept-negotiator')
const pump = require('pump')
const mimedb = require('mime-db')
const intoStream = require('into-stream')
const peek = require('peek-stream')
const { Minipass } = require('minipass')
const pumpify = require('pumpify')
const encodingNegotiator = require('@fastify/accept-negotiator')
const { inherits, format } = require('util')

const { isStream, isGzip, isDeflate } = require('./lib/utils')

Expand Down
8 changes: 4 additions & 4 deletions test/global-compress.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict'

const { test } = require('tap')
const { createReadStream, readFile, readFileSync } = require('fs')
const { Readable, Writable, PassThrough } = require('stream')
const zlib = require('zlib')
const { createReadStream, readFile, readFileSync } = require('node:fs')
const { Readable, Writable, PassThrough } = require('node:stream')
const zlib = require('node:zlib')
const AdmZip = require('adm-zip')
const JSONStream = require('jsonstream')
const Fastify = require('fastify')
const compressPlugin = require('../index')
const { once } = require('events')
const { once } = require('node:events')

test('When `global` is not set, it is `true` by default :', async (t) => {
t.test('it should compress Buffer data using brotli when `Accept-Encoding` request header is `br`', async (t) => {
Expand Down
6 changes: 3 additions & 3 deletions test/global-decompress.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict'

const { test } = require('tap')
const { createReadStream } = require('fs')
const path = require('path')
const zlib = require('zlib')
const { createReadStream } = require('node:fs')
const path = require('node:path')
const zlib = require('node:zlib')
const pump = require('pump')
const Fastify = require('fastify')
const compressPlugin = require('../index')
Expand Down
4 changes: 2 additions & 2 deletions test/routes-compress.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const { test } = require('tap')
const { createReadStream, readFile, readFileSync } = require('fs')
const zlib = require('zlib')
const { createReadStream, readFile, readFileSync } = require('node:fs')
const zlib = require('node:zlib')
const Fastify = require('fastify')
const compressPlugin = require('../index')

Expand Down
6 changes: 3 additions & 3 deletions test/routes-decompress.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict'

const { test } = require('tap')
const { createReadStream } = require('fs')
const path = require('path')
const zlib = require('zlib')
const { createReadStream } = require('node:fs')
const path = require('node:path')
const zlib = require('node:zlib')
const pump = require('pump')
const Fastify = require('fastify')
const compressPlugin = require('../index')
Expand Down
6 changes: 3 additions & 3 deletions test/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const { createReadStream } = require('fs')
const { Socket } = require('net')
const { Duplex, PassThrough, Readable, Stream, Transform, Writable } = require('stream')
const { createReadStream } = require('node:fs')
const { Socket } = require('node:net')
const { Duplex, PassThrough, Readable, Stream, Transform, Writable } = require('node:stream')
const { test } = require('tap')
const { isStream, isDeflate, isGzip } = require('../lib/utils')

Expand Down