compress-brotli
Advanced tools
+21
| The MIT License (MIT) | ||
| Copyright © 2019 Kiko Beats <josefrancisco.verdu@gmail.com> (kikobeats.com) | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
+2
-0
@@ -5,2 +5,4 @@ # Changelog | ||
| ## [1.3.0](https://github.com/Kikobeats/compress-brotli/compare/v1.2.2...v1.3.0) (2021-03-30) | ||
| ### [1.2.2](https://github.com/Kikobeats/compress-brotli/compare/v1.2.1...v1.2.2) (2020-04-23) | ||
@@ -7,0 +9,0 @@ |
+6
-9
@@ -7,3 +7,6 @@ 'use strict' | ||
| const hasNativeAPI = Boolean(zlib.brotliCompress) | ||
| const compress = promisify(zlib.brotliCompress) | ||
| const decompress = promisify(zlib.brotliDecompress) | ||
| const identity = val => val | ||
@@ -21,10 +24,2 @@ | ||
| const compress = hasNativeAPI | ||
| ? promisify(zlib.brotliCompress) | ||
| : iltorb().compress | ||
| const decompress = hasNativeAPI | ||
| ? promisify(zlib.brotliDecompress) | ||
| : iltorb().decompress | ||
| return { | ||
@@ -46,1 +41,3 @@ serialize, | ||
| module.exports = createCompress | ||
| module.exports.stringify = JSONB.stringify | ||
| module.exports.parse = JSONB.parse |
+12
-17
@@ -5,3 +5,3 @@ { | ||
| "homepage": "https://nicedoc.io/Kikobeats/compress-brotli", | ||
| "version": "1.2.2", | ||
| "version": "1.3.0", | ||
| "main": "index.js", | ||
@@ -46,3 +46,2 @@ "author": { | ||
| "git-dirty": "latest", | ||
| "husky": "latest", | ||
| "iltorb": "latest", | ||
@@ -53,2 +52,3 @@ "lint-staged": "latest", | ||
| "prettier-standard": "latest", | ||
| "simple-git-hooks": "latest", | ||
| "standard": "latest", | ||
@@ -59,3 +59,3 @@ "standard-markdown": "latest", | ||
| "engines": { | ||
| "node": ">= 8" | ||
| "node": ">= 12" | ||
| }, | ||
@@ -70,3 +70,3 @@ "files": [ | ||
| "lint": "standard-markdown README.md && standard", | ||
| "postrelease": "npm run release:tags && npm run release:github && ci-publish", | ||
| "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)", | ||
| "prerelease": "npm run update:check && npm run contributors", | ||
@@ -87,22 +87,17 @@ "pretest": "npm run lint", | ||
| }, | ||
| "husky": { | ||
| "hooks": { | ||
| "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", | ||
| "pre-commit": "lint-staged" | ||
| } | ||
| }, | ||
| "lint-staged": { | ||
| "package.json": [ | ||
| "finepack", | ||
| "git add" | ||
| "finepack" | ||
| ], | ||
| "*.js": [ | ||
| "prettier-standard", | ||
| "git add" | ||
| "*.js,!*.min.js,": [ | ||
| "prettier-standard" | ||
| ], | ||
| "*.md": [ | ||
| "standard-markdown", | ||
| "git add" | ||
| "standard-markdown" | ||
| ] | ||
| }, | ||
| "simple-git-hooks": { | ||
| "commit-msg": "npx commitlint --edit", | ||
| "pre-commit": "npx lint-staged" | ||
| } | ||
| } |
+1
-8
@@ -10,7 +10,6 @@ # compress-brotli | ||
| > Simple cross Node.js inteface for using brotli compression | ||
| > Compress/Decompress using Brotli in a simple way. | ||
| ## Highlights | ||
| - Auto detect Node.js brotli API (`>=11.7.0`). | ||
| - Handle edge cases (such as try to compress `undefined`). | ||
@@ -26,8 +25,2 @@ - JSON serialization/deserialization with Buffer support by default. | ||
| In case you are not targeting Node.js v11.7.0 or above, you need to install `iltorb` as extra dependency: | ||
| ```bash | ||
| $ npm install iltorb --save | ||
| ``` | ||
| ## Usage | ||
@@ -34,0 +27,0 @@ |
-21
| The MIT License (MIT) | ||
| Copyright © 2019 Kiko Beats <josefrancisco.verdu@gmail.com> (kikobeats.com) | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
9845
-1.86%33
-8.33%76
-8.43%