Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!