compress-brotli
Advanced tools
Comparing version 1.2.2 to 1.3.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 @@ |
15
index.js
@@ -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 |
@@ -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" | ||
} | ||
} |
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9845
33
76