Comparing version 2.3.2 to 2.4.0
@@ -5,2 +5,10 @@ # Change Log | ||
## [2.4.0] - 2018-07-31 | ||
### Changed | ||
- Updated brotli from [v1.0.4] to [v1.0.5] | ||
- Replaced NAN with N-API | ||
### Removed | ||
- Dropped support for Node 9 | ||
## [2.3.2] - 2018-05-01 | ||
@@ -274,2 +282,3 @@ ### Fixed | ||
[2.4.0]: https://github.com/MayhemYDG/iltorb/compare/v2.3.2...v2.4.0 | ||
[2.3.2]: https://github.com/MayhemYDG/iltorb/compare/v2.3.1...v2.3.2 | ||
@@ -319,2 +328,3 @@ [2.3.1]: https://github.com/MayhemYDG/iltorb/compare/v2.3.0...v2.3.1 | ||
[v1.0.5]: https://github.com/google/brotli/releases/tag/v1.0.5 | ||
[v1.0.4]: https://github.com/google/brotli/releases/tag/v1.0.4 | ||
@@ -321,0 +331,0 @@ [v1.0.3]: https://github.com/google/brotli/releases/tag/v1.0.3 |
28
index.js
@@ -10,13 +10,12 @@ 'use strict'; | ||
const iltorb = require('./build/bindings/iltorb.node'); | ||
const { StreamEncode, StreamDecode } = require('./build/bindings/iltorb.node'); | ||
const { Transform } = require('stream'); | ||
class TransformStreamEncode extends Transform { | ||
constructor(params={}, sync=false) { | ||
constructor(params={}, async=true) { | ||
super(); | ||
this.sync = sync; | ||
this.encoding = false; | ||
this.corked = false; | ||
this.flushing = false; | ||
this.encoder = new iltorb.StreamEncode(params); | ||
this.encoder = new StreamEncode(async, params); | ||
} | ||
@@ -36,3 +35,3 @@ | ||
} | ||
}, !this.sync); | ||
}); | ||
} | ||
@@ -47,3 +46,3 @@ | ||
done(); | ||
}, !this.sync); | ||
}); | ||
} | ||
@@ -83,3 +82,3 @@ | ||
this.uncork(); | ||
}, true); | ||
}); | ||
} | ||
@@ -89,6 +88,5 @@ } | ||
class TransformStreamDecode extends Transform { | ||
constructor(sync=false) { | ||
constructor(async=true) { | ||
super(); | ||
this.sync = sync; | ||
this.decoder = new iltorb.StreamDecode(); | ||
this.decoder = new StreamDecode(async); | ||
} | ||
@@ -103,3 +101,3 @@ | ||
next(); | ||
}, !this.sync); | ||
}); | ||
} | ||
@@ -114,3 +112,3 @@ | ||
done(); | ||
}, !this.sync); | ||
}); | ||
} | ||
@@ -223,4 +221,4 @@ | ||
} | ||
params.size_hint = input.length; | ||
const stream = new TransformStreamEncode(params, true); | ||
params = Object.assign({}, params, {size_hint: input.length}); | ||
const stream = new TransformStreamEncode(params, false); | ||
const chunks = []; | ||
@@ -243,3 +241,3 @@ let length = 0; | ||
} | ||
const stream = new TransformStreamDecode(true); | ||
const stream = new TransformStreamDecode(false); | ||
const chunks = []; | ||
@@ -246,0 +244,0 @@ let length = 0; |
{ | ||
"name": "iltorb", | ||
"version": "2.3.2", | ||
"version": "2.4.0", | ||
"description": "Brotli compression/decompression with native bindings", | ||
@@ -39,16 +39,14 @@ "homepage": "https://github.com/MayhemYDG/iltorb", | ||
"detect-libc": "^1.0.3", | ||
"nan": "^2.10.0", | ||
"npmlog": "^4.1.2", | ||
"prebuild-install": "^3.0.0", | ||
"prebuild-install": "^5.0.0", | ||
"which-pm-runs": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"cross-env": "^5.1.4", | ||
"ava": "^0.25.0", | ||
"cross-env": "^5.2.0", | ||
"cross-spawn": "^6.0.5", | ||
"mocha": "^5.0.5", | ||
"node-abi": "^2.4.0", | ||
"node-gyp": "^3.6.2", | ||
"node-abi": "^2.4.3", | ||
"node-gyp": "^3.7.0", | ||
"npm-run-path-compat": "^2.0.3", | ||
"prebuild": "^7.5.0" | ||
"prebuild": "^7.6.1" | ||
}, | ||
@@ -61,3 +59,3 @@ "scripts": { | ||
"prebuild-upload": "cross-env PUBLISH_BINARY=1 npm run prebuild-ci", | ||
"test": "mocha" | ||
"test": "ava" | ||
}, | ||
@@ -64,0 +62,0 @@ "binary": { |
@@ -11,5 +11,5 @@ const libc = require('detect-libc'); | ||
function build(runtime, target) { | ||
function build({target, runtime, abi}) { | ||
try { | ||
getTarget(target, runtime); | ||
abi && getTarget(target, runtime); | ||
} catch (err) { | ||
@@ -45,18 +45,3 @@ return Promise.resolve(); | ||
const builds = [ | ||
{ runtime: 'node', target: process.versions.modules } | ||
]; | ||
if (PUBLISH_BINARY) { | ||
builds.push( | ||
{ runtime: 'electron', target: '50' }, | ||
{ runtime: 'electron', target: '53' }, | ||
{ runtime: 'electron', target: process.versions.modules } | ||
); | ||
} | ||
builds | ||
.reduce((promise, item) => { | ||
return promise.then(() => build(item.runtime, item.target)).catch((code) => process.exit(code)); | ||
}, Promise.resolve()); | ||
build({ runtime: 'node', target: process.versions.node, abi: false }) | ||
.catch(code => process.exit(code)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1985323
4
7
304
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addeddecompress-response@4.2.1(transitive)
+ Addedexpand-template@2.0.3(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedmimic-response@2.1.0(transitive)
+ Addedmkdirp-classic@0.5.3(transitive)
+ Addednapi-build-utils@1.0.2(transitive)
+ Addedprebuild-install@5.3.6(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsimple-get@3.1.1(transitive)
+ Addedtar-fs@2.1.1(transitive)
+ Addedtar-stream@2.2.0(transitive)
- Removednan@^2.10.0
- Removedbl@1.2.3(transitive)
- Removedbuffer-alloc@1.2.0(transitive)
- Removedbuffer-alloc-unsafe@1.1.0(transitive)
- Removedbuffer-fill@1.0.0(transitive)
- Removeddecompress-response@3.3.0(transitive)
- Removedexpand-template@1.1.1(transitive)
- Removedmimic-response@1.0.1(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removednan@2.22.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedprebuild-install@3.0.0(transitive)
- Removedpump@1.0.32.0.1(transitive)
- Removedsimple-get@2.8.2(transitive)
- Removedtar-fs@1.16.3(transitive)
- Removedtar-stream@1.6.2(transitive)
- Removedto-buffer@1.1.1(transitive)
- Removedxtend@4.0.2(transitive)
Updatedprebuild-install@^5.0.0