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 #34

Open
AbdallahAmmar96 opened this issue Jul 31, 2019 · 0 comments
Open

Best Practice for require #34

AbdallahAmmar96 opened this issue Jul 31, 2019 · 0 comments

Comments

@AbdallahAmmar96
Copy link

project5/src/app.js

Lines 1 to 7 in 93ec7f3

const express = require('express');
const path = require('path');
const bodyParser = require('body-parser')
const app = express();
const controllers = require('./controllers/index')

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

  1. First thing you import the core modules and third-party modules
  2. Add new line
  3. Import your own modules
    like this
const path = require('path');
const express = require('express');

const controllers = require('./controllers/index');

const app = express();
ranasobeid95 added a commit that referenced this issue Aug 1, 2019
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