-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrending.js
More file actions
24 lines (20 loc) · 714 Bytes
/
Copy pathtrending.js
File metadata and controls
24 lines (20 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const Table = require('cli-table3')
const fetch = require('./api/fetch')
const chalk = require('chalk')
const _ = require('lodash')
const green = chalk.green
const table = new Table({
head: [green('Author'), green('Repository'), green('Url'), green('Description'), green('Language'), green('Stars')],
colWidths: [20, 30, 60, 60, 20, 8]
})
module.exports = async function (language, since, spokenLanguage) {
const results = await fetch.fetchRepositories({
language,
since,
spokenLanguage
})
table.push(
..._.map(results, ({author, repositoryName, url, description, language, stars}) => [author, repositoryName, url, description, language, stars])
)
console.log(table.toString())
};