1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | 'use strict';
|
8 |
|
9 | var _ = require('underscore');
|
10 | var Requizzle = require('./lib/requizzle');
|
11 |
|
12 | module.exports = function requizzle(options) {
|
13 | var instance;
|
14 |
|
15 | if (!options || typeof options !== 'object') {
|
16 | throw new TypeError('Requizzle\'s options parameter must be a non-null object.');
|
17 | }
|
18 | options = _.clone(options);
|
19 | options.parent = module.parent;
|
20 |
|
21 | return function(filepath) {
|
22 | instance = instance || new Requizzle(options);
|
23 | return instance.requizzle(filepath);
|
24 | };
|
25 | };
|
26 | module.exports.Requizzle = Requizzle;
|
27 |
|
28 |
|
29 | delete require.cache[__filename];
|