1 | var fs = require('fs');
|
2 |
|
3 | var helpers = {};
|
4 |
|
5 | /**
|
6 | * Read any file as JSON. Unfortunately require can't read a file as JSON unless
|
7 | * it has a .json extension, so this will simulate using require.
|
8 | * @param {string} path
|
9 | * @returns {*}
|
10 | */
|
11 | helpers.requireJSON = function(path) {
|
12 | return JSON.parse(fs.readFileSync(path, 'utf8'));
|
13 | };
|
14 |
|
15 | module.exports = helpers; |
\ | No newline at end of file |