Comparing version 6.5.6 to 6.5.7
@@ -18,2 +18,3 @@ #!/usr/bin/env node | ||
const boxen = require('boxen'); | ||
const promiseTimeout = require('promise-timeout'); | ||
@@ -72,4 +73,3 @@ // Utilities | ||
key: cert.key, | ||
cert: cert.cert, | ||
passphrase: cert.passphrase | ||
cert: cert.cert | ||
}; | ||
@@ -89,15 +89,29 @@ | ||
if (NODE_ENV !== 'production') { | ||
const update = await checkForUpdate(pkg); | ||
try { | ||
const update = await promiseTimeout.timeout(checkForUpdate(pkg), 2000); | ||
if (update) { | ||
const message = `${bold( | ||
'UPDATE AVAILABLE:' | ||
)} The latest version of \`serve\` is ${update.latest}`; | ||
if (update) { | ||
const message = `${bold( | ||
'UPDATE AVAILABLE:' | ||
)} The latest version of \`serve\` is ${update.latest}`; | ||
console.log( | ||
boxen(message, { | ||
padding: 1, | ||
borderColor: 'green', | ||
margin: 1 | ||
}) | ||
); | ||
} | ||
} catch (err) { | ||
console.log( | ||
boxen(message, { | ||
padding: 1, | ||
borderColor: 'green', | ||
margin: 1 | ||
}) | ||
boxen( | ||
`${bold( | ||
'UPDATE CHECK FAILED:' | ||
)} ${err.message}`, { | ||
padding: 1, | ||
borderColor: 'red', | ||
margin: 1 | ||
} | ||
) | ||
); | ||
@@ -104,0 +118,0 @@ } |
{ | ||
"name": "serve", | ||
"version": "6.5.6", | ||
"version": "6.5.7", | ||
"description": "Static file serving and directory listing", | ||
@@ -22,3 +22,3 @@ "scripts": { | ||
"engines": { | ||
"node": ">=6.9.0" | ||
"node": ">=7.6.0" | ||
}, | ||
@@ -63,4 +63,5 @@ "keywords": [ | ||
"path-type": "3.0.0", | ||
"promise-timeout": "1.3.0", | ||
"send": "0.16.2", | ||
"update-check": "1.3.2" | ||
"update-check": "1.5.0" | ||
}, | ||
@@ -67,0 +68,0 @@ "eslintConfig": { |
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
28590
763
23
+ Addedpromise-timeout@1.3.0
+ Addedpromise-timeout@1.3.0(transitive)
+ Addedupdate-check@1.5.0(transitive)
- Removedupdate-check@1.3.2(transitive)
Updatedupdate-check@1.5.0