Comparing version 1.0.1 to 1.1.0
25
index.js
#!/usr/bin/env node | ||
const axios = require('axios'); | ||
const chalk = require('chalk'); | ||
const getTravisCIStatus = require('./travisci.js'); | ||
const getGitHubStatus = require('./github.js'); | ||
const cyan = chalk.cyan; | ||
const purple = chalk.magenta; | ||
const yellow = chalk.yellow; | ||
function createRow(event) { | ||
return ` | ||
-------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
${cyan('Date')}: ${purple(new Date(event.created_on).toLocaleString('en-US', { timeZone: 'America/New_York' }))} | ||
${cyan('Status')}: ${event.status} | ||
${cyan('Message')}: ${yellow(event.body)} | ||
` | ||
async function init() { | ||
getGitHubStatus(); | ||
getTravisCIStatus() | ||
} | ||
axios.get('https://status.github.com/api/messages.json').then((res) => { | ||
const data = res.data.map((d) => createRow(d)).reverse().join(''); | ||
console.log('data: ', data); | ||
}); | ||
init(); |
{ | ||
"name": "gh-system", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -18,4 +18,5 @@ "main": "index.js", | ||
"axios": "^0.18.0", | ||
"chalk": "^2.4.1" | ||
"chalk": "^2.4.1", | ||
"easy-table": "^1.1.1" | ||
} | ||
} |
2675
5
61
3
+ Addedeasy-table@^1.1.1
+ Addedansi-regex@5.0.1(transitive)
+ Addedclone@1.0.4(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addedeasy-table@1.2.0(transitive)
+ Addedwcwidth@1.0.1(transitive)