Skip to content

Commit

Permalink
package-lock debug;
Browse files Browse the repository at this point in the history
drop external gzip
  • Loading branch information
akvlad committed Sep 5, 2024
1 parent ea1d5fc commit e264157
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 86 deletions.
175 changes: 119 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"fastify-plugin": "^4.5.1",
"glob": "^7.1.2",
"handlebars": "^4.7.7",
"handlebars-helpers": "^0.9.8",
"handlebars-helpers": "^0.10.0",
"micromatch": "^4.0.8",
"http-errors": "^2.0.0",
"json-stable-stringify": "^1.0.1",
"jsonic": "^1.0.1",
Expand Down
30 changes: 1 addition & 29 deletions qryn_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,35 +124,7 @@ let fastify = require('fastify')({
done()
}))
await fastify.register(require('@fastify/compress'), {
encodings: ['gzip'],
zlib: {
createGzip: () => {
const deflator = new pako.Deflate({ gzip: true })
let lastChunk = null
const res = new Duplex({
write: (chunk, encoding, next) => {
lastChunk && deflator.push(lastChunk)
lastChunk = chunk
next()
},
read: function (size) {
},
final (callback) {
deflator.onEnd = async () => {
res.push(null)
callback(null)
}
!lastChunk && callback()
lastChunk && deflator.push(lastChunk, true)
},
emitClose: true
})
deflator.onData = (chunk) => {
res.push(chunk)
}
return res
}
}
encodings: ['gzip']
})
await fastify.register(require('@fastify/url-data'))
await fastify.register(require('@fastify/websocket'))
Expand Down

0 comments on commit e264157

Please sign in to comment.