Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scores-table

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scores-table - npm Package Compare versions

Comparing version 0.3.0 to 1.0.0

24

cli.js

@@ -16,5 +16,7 @@ #!/usr/bin/env node

' Options',
' -l Outputs only live matches',
' -f Outputs only finished matches',
' -t <team> Outputs only matches from <team>'
' -l Outputs live matches',
' -f Outputs finished matches',
' -t <team> Outputs matches from <team>',
' -p Outputs matches from the previous day',
' -n Outputs matches from the next day'
].join('\n'));

@@ -61,2 +63,18 @@ }

if (argv === '-p') {
scores.previous(function (err, data) {
if (err) throw err;
console.log('\n' + data);
});
return;
}
if (argv === '-n') {
scores.next(function (err, data) {
if (err) throw err;
console.log('\n' + data);
});
return;
}
scores.all(function (err, data) {

@@ -63,0 +81,0 @@ if (err) throw err;

@@ -1,4 +0,5 @@

var scores = require('scores-parser');
var scores = require('../scores-parser/');
var lib = require('./lib');
var Table = require('cli-table');
var moment = require('moment');

@@ -8,3 +9,3 @@ var table = new Table(lib.options);

module.exports.all = function (cb) {
scores(function (data) {
scores({}, function (data) {
[].forEach.call(data, function (el) {

@@ -19,3 +20,3 @@ el.status = lib.colorify(el.status);

module.exports.live = function (cb) {
scores(function (data) {
scores({}, function (data) {
[].forEach.call(data, function (el) {

@@ -31,3 +32,3 @@ if (!lib.isLive(el.status)) return;

module.exports.finished = function (cb) {
scores(function (data) {
scores({}, function (data) {
[].forEach.call(data, function (el) {

@@ -43,3 +44,3 @@ if (!lib.isFinished(el.status)) return;

module.exports.team = function (team, cb) {
scores(function (data) {
scores({}, function (data) {
[].forEach.call(data, function (el) {

@@ -52,2 +53,26 @@ if (!lib.isPlaying(team, el)) return;

});
}
}
module.exports.previous = function (cb) {
scores({
date: moment().subtract(1, 'days').format('YYYY-MM-DD')
}, function (data) {
[].forEach.call(data, function (el) {
el.status = lib.colorify(el.status);
table.push([el.status, el.home, el.result, el.away]);
});
cb(null, table.toString());
})
}
module.exports.next = function (cb) {
scores({
date: moment().add(1, 'days').format('YYYY-MM-DD')
}, function (data) {
[].forEach.call(data, function (el) {
el.status = lib.colorify(el.status);
table.push([el.status, el.home, el.result, el.away]);
});
cb(null, table.toString());
})
}

5

package.json
{
"name": "scores-table",
"version": "0.3.0",
"version": "1.0.0",
"description": "football results in your command line",

@@ -26,4 +26,5 @@ "bin": {

"colors": "^1.0.3",
"scores-parser": "1.0.1"
"scores-parser": "2.0.0",
"moment": "^2.8.3"
}
}

@@ -37,4 +37,16 @@ # scores-table

#### previous day results
```
$ scores-table -p
```
#### next day results
```
$ scores-table -n
```
## License
MIT
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc