h2-auto-push
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -92,3 +92,3 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
stream.pushStream({ ':path': asset }, pushStream => { | ||
const pushFile = (pushStream) => { | ||
pushStream.on('finish', () => { | ||
@@ -102,3 +102,2 @@ resolve(); | ||
onError: (err) => { | ||
console.error(err); | ||
pushStream.end(); | ||
@@ -108,3 +107,11 @@ reject(err); | ||
}); | ||
}); | ||
}; | ||
stream.pushStream({ ':path': asset }, | ||
// Node 9.4.0 changed the callback function signature, hence casting | ||
((err, pushStream) => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
pushFile(pushStream); | ||
})); | ||
}); | ||
@@ -111,0 +118,0 @@ }); |
{ | ||
"name": "h2-auto-push", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "HTTP/2 auto-push library", | ||
@@ -25,2 +25,5 @@ "main": "build/src/index.js", | ||
}, | ||
"engines": { | ||
"node": ">=9.4.0 || >8.9.4 <9" | ||
}, | ||
"keywords": [ | ||
@@ -48,7 +51,10 @@ "http2", | ||
"devDependencies": { | ||
"@types/get-port": "^3.2.0", | ||
"@types/node": "^9.3.0", | ||
"@types/semver": "^5.4.0", | ||
"ava": "^0.24.0", | ||
"codecov": "^3.0.0", | ||
"get-port": "^3.2.0", | ||
"gts": "^0.5.3", | ||
"js-green-licenses": "^0.3.1", | ||
"js-green-licenses": "^0.4.0", | ||
"nyc": "^11.4.1", | ||
@@ -55,0 +61,0 @@ "typescript": "~2.6.2" |
@@ -30,2 +30,4 @@ # HTTP/2 automatic server push | ||
**This package currently works only with Node >=9.4.0.** | ||
## Interface | ||
@@ -32,0 +34,0 @@ |
Sorry, the diff of this file is not supported yet
38380
288
147
10