Gathering detailed insights and metrics for compress-brotli
Gathering detailed insights and metrics for compress-brotli
Gathering detailed insights and metrics for compress-brotli
Gathering detailed insights and metrics for compress-brotli
Simple cross Node.js inteface for using brotli compression
npm install compress-brotli
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
42 Stars
79 Commits
5 Forks
3 Watching
1 Branches
3 Contributors
Updated on 06 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-16.6%
47,843
Compared to previous day
Last week
-2.7%
294,059
Compared to previous week
Last month
-2.4%
1,252,662
Compared to previous month
Last year
-53.4%
21,032,724
Compared to previous year
Compress/Decompress using Brotli in a simple way.
undefined
).1$ npm install compress-brotli --save
1const createCompress = require('compress-brotli') 2 3// It exposes compress/decompress methods 4const { compress, decompress } = createCompress()
using v8 serialization:
1const createCompress = require('compress-brotli') 2const v8 = require('v8') 3 4const { compress, decompress } = createCompress({ 5 serialize: v8.serialize, 6 deserialize: v8.deserialize 7})
customizing compress options:
1const createCompress = require('compress-brotli') 2 3const { 4 constants: { 5 BROTLI_MODE_TEXT, 6 BROTLI_PARAM_MODE, 7 BROTLI_PARAM_QUALITY 8 } 9} = require('zlib') 10 11// Provide factory level default options 12const { compress, decompress } = createCompress({ 13 compressOptions: { 14 chunkSize: 1024, 15 parameters: { 16 [BROTLI_PARAM_MODE]: BROTLI_MODE_TEXT 17 } 18 }, 19 decompressOptions: { 20 chunkSize: 1024, 21 parameters: { 22 [BROTLI_PARAM_MODE]: BROTLI_MODE_TEXT 23 } 24 } 25}) 26const data = 'whatever' 27 28// Override call level options (deep merge for parameters) 29const compressed = compress(data, { 30 parameters: { 31 [BROTLI_PARAM_QUALITY]: 7 32 } 33}) 34decompress(compressed, { 35 chunkSize: 2048 36})
Type: boolean
Default: false
If pass disable, it will return a noop compress/decompress methods.
Type: function
Default: JSONB.stringify
It determines the serialize method to use before compress the data.
Type: function
Default: JSONB.parse
It determines the deserialize method to use after decompress the data.
Type: zlib.BrotliOptions
Default: {}
i.e. default zlib.brotliCompress options will be used
It defines default options to be used in wrapped zlib.brotliCompress call
Type: zlib.BrotliOptions
Default: {}
i.e. default zlib.brotliDecompress options will be used
It defines default options to be used in wrapped zlib.brotliDecompress call
compress-brotli © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 2/20 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More