Comparing version 1.0.0 to 1.0.2
@@ -17,6 +17,8 @@ #!/usr/bin/env node | ||
function printResult(stocks) { | ||
console.log('stocks', stocks); | ||
var toPrint = stocks.reduce(function(prev, stock) { | ||
var l = stock.l; // close price (previous trading day) | ||
var p = stock.el; // stock price in pre-market (after-hours) | ||
return prev + sprintf("%s %d (%.2f%%) ", stock.t, p, (p - l) * 100/l); | ||
// stock.el quotes in pre-market | ||
// stock.l quotes during the market | ||
var p = stock.el || stock.l; | ||
return prev + sprintf("%s %.2f (%.2f%%) ", stock.t, p, stock.cp); | ||
}, ''); | ||
@@ -23,0 +25,0 @@ console.log(toPrint); |
{ | ||
"author": "chunghe", | ||
"name": "gticker", | ||
"version": "1.0.0", | ||
"description": "command line stock ticker", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -6,0 +7,0 @@ "main": "index.js", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
10046
5
31
1
25