N
N
Nwton2016-07-05 21:43:46
Node.js
Nwton, 2016-07-05 21:43:46

How to specify the parent directory when connecting a module?

1) Suppose I run a file at a/b/c/index.js
2) Then, if I need to include a module at a/b/c/module.js, I will do it like this:
module = require('./module')
3) How to include a module at a/b/module.js, i.e. one level up?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question