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

134
Vistas
Node.js/JS converting standard windows paths to useable file path for CLI application

I am very new to node and JavaScript, but I have a simple Node.js CLI application working that extracts images from Photoshop .PAT files and saves them to a specified directory.

I've noticed that in order for the paths that I pass in as arguments (input_pat for the input .pat file, and output_dir for the destination directory) they must either use forward slashes, or double backslashes or Node freaks out.

What I want to be able to do is this:

node save.js "C:\patterns\library.pat" "C:\Users\user\Desktop\pat-parser-master\src\save\"

Is there a way to convert standard windows path notation into a format that javascript will accept? I.E. replacing all backslashes with forward slashes, or doubling up the backslashes?

Must I always use double backslashes or forward slashes when passing in paths?

Any help or guidance would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
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