Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

compress.js 504 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. const { promisify } = require('util')
  2. const zlib = require('zlib')
  3. const brotliCompress = promisify(zlib.brotliCompress)
  4. const brotliDecompress = promisify(zlib.brotliDecompress)
  5. const options = {
  6. params: {
  7. [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
  8. [zlib.constants.BROTLI_PARAM_QUALITY]: 6
  9. }
  10. }
  11. module.exports = {
  12. async compress (data) {
  13. return brotliCompress(data, options)
  14. },
  15. async decompress (data) {
  16. return brotliDecompress(data, options)
  17. }
  18. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...