0
0
Node.jsframework~5 mins

Resource naming conventions in Node.js - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main purpose of resource naming conventions in Node.js projects?
Resource naming conventions help keep code organized, readable, and consistent. They make it easier for developers to find and understand files and folders.
Click to reveal answer
beginner
Why should resource names be lowercase and use hyphens instead of spaces or underscores?
Lowercase with hyphens improves readability and avoids issues with case sensitivity on different operating systems. Hyphens separate words clearly without confusion.
Click to reveal answer
intermediate
In Node.js, how should you name folders that contain multiple related files?
Use plural nouns in lowercase with hyphens, like 'controllers', 'middlewares', or 'routes'. This shows the folder holds many related resources.
Click to reveal answer
intermediate
How should you name JavaScript files that export a single class or function?
Use lowercase with hyphens for the file name, matching the resource purpose, like 'user-controller.js'. The exported class or function inside uses PascalCase.
Click to reveal answer
beginner
What naming style is recommended for environment variable files in Node.js projects?
Use lowercase '.env' style, like '.env' or '.env.production'. This style clearly distinguishes environment files from code files.
Click to reveal answer
Which naming style is best for a folder containing multiple route files in a Node.js project?
ARoute-Files
BRouteFiles
Croute_files
Droutes
How should you name a JavaScript file exporting a single controller class?
AUserController.js
Buser_controller.js
Cuser-controller.js
Dusercontroller.js
Why avoid uppercase letters in file and folder names in Node.js projects?
AThey cause issues on case-sensitive systems
BThey slow down the app
CThey look unprofessional
DThey are harder to type
What is the recommended naming style for environment variable files?
A.Env
B.env
C.ENV
D.env_file
Which of these is a good resource name for a middleware folder?
Amiddlewares
BMiddleware
Cmiddleware_files
DMiddleware-Files
Explain why consistent resource naming conventions are important in Node.js projects.
Think about how naming affects teamwork and code clarity.
You got /4 concepts.
    Describe the recommended naming style for folders, files, and environment files in Node.js projects.
    Focus on lowercase, plurals for folders, hyphens for files, and special env file naming.
    You got /4 concepts.