DEV Community

Discussion on: Organizing my NodeJS code and folder structure

eddie023 profile image
Manish Chaulagain

We call it utilities. Suppose there is one function to catch the unique key constraint of sql server. This function is not dependent specifically to what project you are working per se. And can be copied and used in any projects that use sql servers.

Also,suppose you have to use some js library many times to perform some logic. For example use ramda intersection method to find the common items in two list. You can abstract this logic with your own "helper" function so that you dont import ramda in every file it requires.

Get the gist? Helpers function are something that's independent to your current project and something you create to make your code reusable and your life lot easier. Common helper function could be like formatting the given date, checking if the given date is this week etc.

Hope this helps you understand what helper functions are. Cheers!

nipeshkc7 profile image
Arpan Kc Author

First of all, sorry for the late response. And second this really clears a lot of stuff for me and will definitely be making some changes to my current project structure. Thanks !!!