Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

primeros pasos#9

Open
CarmenMerino wants to merge 2 commits into
Laboratoria:mainfrom
CarmenMerino:main
Open

primeros pasos#9
CarmenMerino wants to merge 2 commits into
Laboratoria:mainfrom
CarmenMerino:main

Conversation

@CarmenMerino

Copy link
Copy Markdown

No description provided.

@unjust unjust left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buena codigo y ordenado. Escriba su primero funcion y pon la logica dentro. Este script peue llamar console.log(myFunction(...) a final para probar y de alli escriba tu primer test.

Comment thread index.js Outdated

fs.readFile('links.md', 'utf-8')
.then((contenidos) => {
let links = contenidos.split('\n')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const y creo seria lines mejor nombre porque son lineas de texto

Comment thread index.js Outdated
let links = contenidos.split('\n')
for(let i=0; i<links.length; i++){
console.log((i+1)+':'+links[i])
http.get(links[i], (res) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

veo que estas experimentando aqui con http... pero mas adelante haz eso. enfoca ahora en los primeros pasos de tu diagrama de flujo

Comment thread index.js Outdated
const fs = require('node:fs/promises');
const http = require('node:https')

fs.readFile('links.md', 'utf-8')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mas que solo llamar readFile ... crear tu propio funcion alrededor que toma un parametro para la ruta de archivo y pasa por readFile.
de alli puedes escribir su primero test de este nueva funcion.

👁️ Se que quieres practicar con promesas pero tambien hay readFileSync que es sincrona.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants