| 12 | * @name CSScomb |
| 13 | */ |
| 14 | let CSScomb = function(config) { |
| 15 | let comb = new Comb(); |
| 16 | |
| 17 | // Add plugins. |
| 18 | fs.readdirSync(__dirname + '/options').map(function(option) { |
| 19 | return require('./options/' + option); |
| 20 | }).forEach(function(option) { |
| 21 | comb.use(option); |
| 22 | }); |
| 23 | |
| 24 | // If config was passed, configure: |
| 25 | if (typeof config === 'string') { |
| 26 | config = CSScomb.getConfig(config); |
| 27 | } |
| 28 | if (typeof config === 'object') { |
| 29 | comb.configure(config); |
| 30 | } |
| 31 | |
| 32 | // Chaining. |
| 33 | return comb; |
| 34 | }; |
| 35 | |
| 36 | /** |
| 37 | * STATIC METHODS |