It seemed like a straight forward problem. But I amn't able to crack this.
Within helper1.js I would like to access foobar.json (from config/dev/
)
root
-config
--dev
---foobar.json
-helpers
--helper1.js
I couldn't get this to work fs: how do I locate a parent folder?
Any help here would be great.
Simple! The folder named ..
is the parent folder, so you can make the path to the file you need as such
var foobar = require('../config/dev/foobar.json');
If you needed to go up two levels, you would write ../../
etc
Some more details about this in this SO answer and it's comments
Source: Stackoverflow.com