Y
Y
yankoyski2019-05-12 18:53:33
Node.js
yankoyski, 2019-05-12 18:53:33

How to correctly connect common methods in express?

It is inconvenient to connect modules via a relative path: ../../../module.
How to connect simply: module?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2019-05-12
@yankoyski

https://www.npmjs.com/package/module-alias
You can of course do something like this, but "Inconvenient" is solved by using an IDE with autocompletion, when you write something like let someVar = moduleFunction() in the code, it automatically adds import of the required module (and even a specific function if there are different exports in the module).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question