Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fetchNewLatest() {
const now = this.dateTimeHelper.getNow();
const url =
"https://api.tfl.gov.uk/Line/Mode/tube,dlr,tflrail,overground/Status" +
`?app_id=${this.config.TFL_APP_ID}` +
`&app_key=${this.config.TFL_APP_KEY}`;
this.logger.info("Fetching from TFL");
// only include this require on invocation (so the memory is cleared)
return require("node-fetch")(url) // eslint-disable-line global-require
.then(response => response.json())
.then(this.mutateData.bind(this))
.then(data => this.storeStatus(now, data));
}
(async () => {
require('node-fetch')('https://api.github.com/repos/1995parham/github-do-not-ban-us')
.then(data => data.json())
.then(data => console.log(`
GitHub is for everyone!
❤️️ to everyone of you ${data.forks} people!
The newest 100 forks:`))
.then(() => require('node-fetch')('https://api.github.com/repos/1995parham/github-do-not-ban-us/forks?per_page=100'))
.then(data => data.json())
.then(data => data.forEach(repo => console.log(`- ${repo.owner.login}`)))
})()