-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terremotos por consola con Nodejs #86
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objetivo logrado, pero falta validar inputs y optimizar un poco las salidas por consola. 😉
@@ -0,0 +1,39 @@ | |||
const https = require('https'); | |||
|
|||
const [,,grade, frecuency] = process.argv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bueno... ,,
no es un mal hack, pero según como sea el equipo ... igual alguien podría molestarse. Por lo general, la norma no escrita dice que la idea es saltar una única posición del array
const https = require('https'); | ||
|
||
const [,,grade, frecuency] = process.argv; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grade
podría ser cualquier cosa y generarte errores en la URL...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lo mismo se aplica para frecuency
console.log(new Date(parsed.metadata.generated).toLocaleString('es-ES')); | ||
console.log('=============================='); | ||
parsed.features.forEach(feature => { | ||
console.log(feature.properties.title); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sería más interesante montar un bloque de texto con toda la información y hacer console.log
una vez por vuelta o al final del todo usando un map
con un join
const text = parsed.features.map(lorem_ipsum).join('');
console.log(text)
Terremotos por consola con Nodejs