| Total Complexity | 4 |
| Complexity/F | 1.33 |
| Lines of Code | 38 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | // import in package.json via |
||
| 6 | var the_patternlibrary; |
||
| 7 | |||
| 8 | // import main Patternlibrary class from file; |
||
| 9 | var Patternlibrary = require ( './lib/patternlibrary.js' ); |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Patternlibrary instance factory |
||
| 13 | * |
||
| 14 | * The first time the function is invoked in the stream, a new instance of |
||
| 15 | * the pattern-library is created with the given options. |
||
| 16 | * |
||
| 17 | * @param {object} options - Configuration options to pass to the new instance. |
||
| 18 | * @returns {function} Transform stream function that renders HTML pages. |
||
| 19 | */ |
||
| 20 | module.exports = function(options) { |
||
| 21 | if (!the_patternlibrary) { |
||
| 22 | the_patternlibrary = new Patternlibrary(options); |
||
| 23 | //the_patternlibrary.refresh(); |
||
| 24 | } |
||
| 25 | |||
| 26 | // return initialized Patternlibrary |
||
| 27 | return the_patternlibrary; |
||
| 28 | }; |
||
| 29 | |||
| 30 | module.exports.Patternlibrary = Patternlibrary; |
||
| 31 | |||
| 32 | |||
| 33 | /** |
||
| 34 | * CLI help message |
||
| 35 | */ |
||
| 36 | var help = function () { |
||
| 37 | var txt = 'Usage: ...'; |
||
| 38 | process.stdout.write(txt); |
||
| 39 | }; // require('./lib/helpMessage'); |
||
| 40 | |||
| 41 | module.exports.help = function() { |
||
| 42 | help(); |
||
| 43 | }; |
||
| 44 |