Question
It seemed like a straight forward problem. But I am not 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
How-To
You can use the path module to join the path of the directory in which helper1.js lives to the relative path of foobar.json. This will give you the absolute path to foobar.json:
- var fs = require('fs');
- var path = require('path');
- var jsonPath = path.join(__dirname, '..', 'config', 'dev', 'foobar.json');
- var jsonString = fs.readFileSync(jsonPath, 'utf8');
Strange "water hack" burns 2 lbs overnight
回覆刪除Over 160 thousand women and men are losing weight with a simple and secret "liquids hack" to lose 2 lbs each night in their sleep.
It's easy and works on everybody.
This is how you can do it yourself:
1) Take a drinking glass and fill it with water half full
2) And then learn this weight loss HACK
and become 2 lbs lighter the next day!