1 | ;
|
2 |
|
3 | module.exports = function (filepath, options) {
|
4 | options = options || {raw: false};
|
5 | var file = this.store.get(filepath);
|
6 |
|
7 | if (file.state === 'deleted' || file.contents === null) {
|
8 | if ('defaults' in options) {
|
9 | return options.defaults;
|
10 | }
|
11 |
|
12 | throw new Error(filepath + ' doesn\'t exist');
|
13 | }
|
14 |
|
15 | return options.raw ? file.contents : file.contents.toString();
|
16 | };
|