160
rated 0 times
[
161]
[
1]
/ answers: 1 / hits: 46538
/ 7 Years ago, fri, february 10, 2017, 12:00:00
I have the following structure:
-- node_modules
-- websites
---- common
------- config.js
---- testing
------- test.js
Inside config I have some variables set, which are being exported using module.export.
I am trying to retrieve those variables when running node test.js
from config.js using the following codes:
var configData = require('./common/config.js')
var configData = require('../common/config.js')
None of them work. What can I do to retrieve the data from the other folder?
More From » node.js