index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * Module dependencies
  3. */
  4. var build = require('./lib/build');
  5. var getMethodName = require('./lib/get-method-name');
  6. var pack = require('./lib/pack');
  7. var buildWithCustomUsage = require('./lib/build-with-custom-usage');
  8. var RELEASE_LICENSE = require('./package.json').license;
  9. var RELEASE_SERIES = 'gen2';
  10. var RELEASE_VERSION = require('./package.json').version;
  11. /**
  12. * Machine()
  13. *
  14. * @type {Function}
  15. * @properties
  16. * .build()
  17. * .buildWithCustomUsage()
  18. * .pack()
  19. * .getMethodName()
  20. */
  21. module.exports = build;
  22. // ███████╗████████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗
  23. // ██╔════╝╚══██╔══╝██╔══██╗╚══██╔══╝██║██╔════╝ ████╗ ████║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗██╔════╝
  24. // ███████╗ ██║ ███████║ ██║ ██║██║ ██╔████╔██║█████╗ ██║ ███████║██║ ██║██║ ██║███████╗
  25. // ╚════██║ ██║ ██╔══██║ ██║ ██║██║ ██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║╚════██║
  26. // ███████║ ██║ ██║ ██║ ██║ ██║╚██████╗ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝██████╔╝███████║
  27. // ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
  28. //
  29. /**
  30. * .getMethodName()
  31. *
  32. * See lib/get-method-name.js
  33. */
  34. module.exports.getMethodName = getMethodName;
  35. /**
  36. * .pack()
  37. *
  38. * See lib/pack.js
  39. */
  40. module.exports.pack = pack;
  41. /**
  42. * .VERSION
  43. * .version
  44. *
  45. * @type {String}
  46. */
  47. module.exports.VERSION = RELEASE_VERSION;
  48. module.exports.version = RELEASE_VERSION;//« for backwards compatibility
  49. /**
  50. * .inspect()
  51. *
  52. * When the Machine constructor is inspected (e.g. `util.inspect()` / `console.log()`),
  53. * pretty print the current version of node-machine, with license information and a link
  54. * to the documentation.
  55. *
  56. * @returns {String}
  57. */
  58. module.exports.inspect = function () {
  59. return ''+
  60. '---------------------------------------------------\n'+
  61. ' machine'+/*' (runtime environment)'+*/'\n'+
  62. ' v'+RELEASE_VERSION+' ('+RELEASE_SERIES+')\n'+
  63. ' \n'+
  64. ' • License : '+RELEASE_LICENSE+'\n'+
  65. ' • Package : http://npmjs.com/package/machine\n'+
  66. ' • Questions : https://sailsjs.com/support\n'+
  67. '---------------------------------------------------\n';
  68. };
  69. /**
  70. * .build()
  71. *
  72. * Build a wet (callable) machine.
  73. *
  74. * @returns {Function}
  75. */
  76. module.exports.build = build;
  77. /**
  78. * .buildWithCustomUsage()
  79. *
  80. * Return a machine function with a custom usage style.
  81. *
  82. * @property {Dictionary} def
  83. * @property {String?} arginStyle ("named" or "serial")
  84. * @property {String?} execStyle ("deferred" or "immediate")
  85. */
  86. module.exports.buildWithCustomUsage = buildWithCustomUsage;