DEV Community

Cover image for Create a backend in Javascript (part 2): NodeJS Module System

Create a backend in Javascript (part 2): NodeJS Module System

Eric The Coder on September 30, 2021

Here is a series of articles to help you create backend applications in Javascript. Node.js is now a must, so it is essential for a developer to m...
Collapse
 
beauspot profile image
Iyere Handsome(Beau) Omogbeme

There is a bug on your code in the module app.js. You are exporting the greeting function but then when you want to import it you don't use the greeting function in another module rather you say require('app.js'), not 'greeting'. if you run the code It would throw an error stating that the module greeting cannot be found. greeting() is not a module rather it is a function that is exported from a module to another. I would upload Images for you to see what I am saying.

Collapse
 
beauspot profile image
Iyere Handsome(Beau) Omogbeme

This code would return an error stating that the module cannot be found

Collapse
 
jitendradadhich profile image
Jitendra Dadhich

Thanks for sharing

Collapse
 
ericchapman profile image
Eric The Coder

You're welcome !

Collapse
 
abdullmng profile image
abdullmng

I look forward to learning from you

Collapse
 
mayarabtm profile image
Mayara B.

Cool, thanks for sharing.

Collapse
 
salehmubashar profile image
Saleh Mubashar

Thanks,
Can you also make one for how to connect node with database and use node,react and a databse together . thanks

Collapse
 
ericchapman profile image
Eric The Coder

The database part in almost done but I am not sure I will do the React Part.

Collapse
 
salehmubashar profile image
Saleh Mubashar

oh okay, thx

Collapse
 
merite15 profile image
Merite15

Are you writing an article about express js

Collapse
 
ericchapman profile image
Eric The Coder

Yes ExpressJS articles are coming right after NodeJS.

Many of them are already written.

Collapse
 
andycharles6 profile image
andycharles6

Can you also cover Adonisjs in an article? I think it can be used as a reference for batteries included framework.

Express- A simple and small Node framework
Adonisjs - Batteries included and more structured framework.

Thanks. Keep up the great work

Collapse
 
idsudeep profile image
sudeep

Thank you