Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

84
Vistas
JavaScript Sequental operation

What is the best way/pattern to perform sequental operations in JS(NodeJS)? E.g. Create folder->copy file->edit file->etc. This is stand-alone app, so thread-blocking oprations is ok(Sync).

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Don't. Get in the habit of writing async code in node everywhere, even if it doesn't need to be. It's just good practice, prevents refactoring a bunch of stuff in the future, and with modern JS it's simple to write:

import { mkdir, copyFile } from 'fs/promises';

async function createThing() {
    await mkdir('/path/to/dir');
    await copyFile(src, dest);
    ...
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

Just use async/await for sequential, asynchronous operations. No need to write sync code that you'll regret later. Also, depending on the application, you might get trivial speedup opportunities by doing things concurrently.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda