Skip to content
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

Diagrama flujo #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { mdLinks } = require('./index.js');
mdLinks('/noexiste/').then(() => {})
.catch((error) => {
console.log(error)});
309 changes: 309 additions & 0 deletions diagrama.drawio

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
module.exports = () => {
// ...
const fs = require('fs');

const mdLinks = (path, options) =>{
return new Promise((resolve, reject) => {
// Identificar si la ruta exite
if (fs.existsSync(path)){ //Si la ruta no existe se rechaza la promesa
// Chequear o convertir a una ruta absoluta
// Probar si es una ruta absoluta es un archivo o un directorio
// Si es un directorio filtrar los archivos md.
} else {
//Si la ruta no existe se rechaza la promesa
reject('La ruta no existe')
}
});
}

module.exports = {
mdLinks
};
Loading