4 ms·
> What can I do to lower the barrier-of-entry to just write code, and stop fiddling with files, folders, modules, repos, function naming, etc? If your goal is
by zachrose 10y ago
> What can I do to lower the barrier-of-entry to just write code, and stop fiddling with files, folders, modules, repos, function naming, etc?
If your goal is to write code with as little overhead as possible, put your code in a JavaScript file and bring it into the global namespace of your site with a <script> tag.
> I feel like I write the same couple of functions over and over again, reinventing the wheel again and again.
If your goal is to organize your code so you don't have to write as much of it, then fiddling with files, folders and modules is a worthwhile investment of your time.
At the risk of inducing JavaScript fatigue, I recommend using a tool that will compile single JavaScript files out of multiple linked CommonJS modules. There are two main tools that do this, Webpack and Browserify, and they're by-and-large interchangeable. Use Webpack if you want to be told which one to use.
> I want naming conventions for files and folders as well as functions themselves.
Naming conventions are orthagonal to the actual organization of your code. Be aware that different projects use different conventions, and hopefully make peace with that. For your own projects, find a style guide you like and stick with it. I like this one: http://nodeguide.com/style.html http://nodeguide.com/style.html.