Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best Practice for require #36

Open
ranasobeid95 opened this issue Feb 20, 2020 · 0 comments
Open

Best Practice for require #36

ranasobeid95 opened this issue Feb 20, 2020 · 0 comments

Comments

@ranasobeid95
Copy link

const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
const routes = require('./routers');
const controllers = require('./controllers');
require('dotenv').config();

All require in the top of your files, and here is a suggestion

  • First thing you import the core modules and third-party modules
  • Add new line
  • Import your own modules
    like this :
require('dotenv').config();
const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');

const routes = require('./routers');
const controllers = require('./controllers');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant