Just like a function would have its single responsibility. They typically cover: 1. I keep getting th... Sending email with gmail smtp with codeigniter email libraryWhat is the javascript filename naming convention? Open source and radically transparent.We're a place where coders share, stay up-to-date and grow their careers. Each has a reason for the name, each has a difference in its responsibility.

The file containing this classes should follow the modul naming convention: Modules should have short, all-lowercase names. You get lots of files, loads of components etc.So in general how do you make sure that you understand what something is? I have definitely worked with this approach, you tend to get that sort of structure with something like Angular.I would imagine that you keep similar functionalities at some commons layer?I like the {resource_name}. Should files be named something-with-hyphens.js, camelCased.js, or something else?One possible naming convention is to use something similar to the naming scheme jQuery uses. Classes or components are UpperPascal. The contents of the docstring found in the javascript file will be added as is following the module declaration. Questions: My application was working fine, and it stopped after trying to get the documentation with swagger, i think it may be a dependency issue, but can’t find it anywhere. So you are working in your company, personal project or whatever it may be and it starts to scale. I love code. The classes in this module/file should be called according to the class naming convention: Class names should normally use the CapWords convention. To reduce … Frontend Software Developer JavaScript programs started off pretty small — most of its usage in the early days was to do isolated scripting tasks, providing a bit of interactivity to your web pages where needed, so large scripts were generally not needed. I prefer naming files with hyphens because then I don’t have to reach for the shift key, as I do when dealing with camelCase file names; and because I don’t have to worry about differences between Windows and Linux file names (Windows file names are case-insensitive, at least through XP).So the answer, like so many, is “it depends” or “it’s up to you.” The one rule you should follow is to be consistent in the convention you choose.I generally prefer hyphens with lower case, but one thing not yet mentioned is that sometimes it’s nice to have the file name exactly match the name of a single module or instantiable function contained within.For example, I have a revealing module declared with Similarly, since I’m using a bundling mechanism to combine scripts, I’ve taken to defining instantiable functions (templated view models etc) each in their own file, C# style, for maintainability. This provides an entry in the module index. Don't compile for any module system. No treatment will be done on the doctring. let's say feature X is some sort of blog functionality, it'll break down something like thisSince I am using svelte nowadays, templates are found in Ah I follow you now! Namespacing: A top-level module is put into a global variable. Whether it loves me back is another question.Create templates to quickly answer FAQs or store snippets for re-use.Usually in our codebases these 'groups' would have their own directory. Its just a different approach to file splitting.So the question comes in how do you go about naming and scaling your code base? There are some various options: scriptName.js; script-name.js; script_name.js; are all valid naming conventions, however I prefer the jQuery suggested naming convention (for jQuery plugins, although it works for any JS) jquery.pluginname.js Thanks for the insight!I am used to a module organised with a MVC approach.I see so you take the approach of grouping by module. As usual, you can access a module by its name in the global scope. {folder_name}.js approach.

It’s not universally adopted but it is pretty common.I’m not aware of any particular convention for javascript files as they aren’t really unique on the web versus css files or html files or any other type of file like that.