Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

249
Visualizações
Why do JavaScript filenames sometimes have dots?

I have the following question and is it because there are javascript file names with dots?

For example:

In a node js project with express, I found the following files:

user.route.js

user.controller.js

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Because it very clearly when you read the filename, you can know the responsibility of file, object is handling, Business model of project. Easy maintain, fix bug.

about 4 years ago · Juan Pablo Isaza Relatório

0

It is the same reason why you put files in different directories. Why would we do that? We want to organize the files in a manageable manner. So, we put routing related files in routes directory, business logic related files in service directory.

Another way of organizing files is to have the type of the file mentioned in the name itself. The file name user.route.js says, it contains routes related to user. The file user.controller.js says, it contains controller functions related to user.

If you think more about it, it is similar to having extensions in file names. Files ends with .js tells us, it is a JavaScript file. Same goes for .css, .html, etc files. The same way, files ends with .route.js tells us, it is a file that has routing related JavaScript code. So, what does files that ends with .controller.js tells you?

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda