bajo
Version:
The ultimate framework for whipping up massive apps in no time
1 lines • 36.1 kB
JSON
{"list":[{"title":"App","link":"<a href=\"App.html\">App</a>"},{"title":"App#addPlugin","link":"<a href=\"App.html#addPlugin\">addPlugin</a>","description":"<p>Add and save plugin and it's class definition (if provided)</p>"},{"title":"App#applet","link":"<a href=\"App.html#applet\">applet</a>","description":"<p>If app runs in applet mode, this will be the applet's name</p>"},{"title":"App#applets","link":"<a href=\"App.html#applets\">applets</a>","description":"<p>Applets</p>"},{"title":"App#args","link":"<a href=\"App.html#args\">args</a>","description":"<p>Program arguments</p>\n<pre class=\"prettyprint source\"><code>$ node index.js arg1 arg2\n...\nconsole.log(this.args) // it should print: ['arg1', 'arg2']\n</code></pre>"},{"title":"App#argv","link":"<a href=\"App.html#argv\">argv</a>","description":"<p>Program options.</p>\n<ul>\n<li>Dash (<code>-</code>) breaks the string into object keys</li>\n<li>While colon (<code>:</code>) is used as namespace separator. If no namespace found, it is saved under <code>_</code> key.</li>\n</ul>\n<p>Values are parsed automatically. See {@link https://github.com/ladjs/dotenv-parse-variables|dotenv-parse-variables}\nfor details.</p>\n<pre class=\"prettyprint source\"><code>$ node index.js --my-name-first=John --my-name-last=Doe --my-birthDay=secret --nameSpace:path-subPath=true\n...\n// {\n// _: {\n// my: {\n// name: { first: 'John', last: 'Doe' },\n// birthDay: 'secret'\n// }\n// },\n// nameSpace: { path: { subPath: true } }\n// }\n</code></pre>"},{"title":"App#boot","link":"<a href=\"App.html#boot\">boot</a>","description":"<p>Boot process:</p>\n<ul>\n<li>Parsing {@link module:Lib.parseArgsArgv|program arguments, options} and {@link module:Lib.parseEnv|environment values}</li>\n<li>Create {@link Bajo|Bajo} instance & initialize it</li>\n<li>{@link module:Helper/Bajo.runAsApplet|Run in applet mode} if <code>-a</code> or <code>--applet</code> is given</li>\n</ul>\n<p>After boot process is completed, event <code>bajo:afterBootComplete</code> is emitted.</p>\n<p>If app mode is <code>applet</code>, it runs your choosen applet instead.</p>"},{"title":"App#configHandlers","link":"<a href=\"App.html#configHandlers\">configHandlers</a>","description":"<p>Config handlers.</p>\n<p>By default, there are two built-in handlers available: <code>.js</code>\nand <code>.json</code>. Use plugins to add more, e.g {@link https://github.com/ardhi/bajo-config|bajo-config}\nlets you to use <code>.yaml/.yml</code> and <code>.toml</code></p>"},{"title":"App#dump","link":"<a href=\"App.html#dump\">dump</a>","description":"<p>Dumping variable on screen. Like <code>console.log</code> but with max 10 depth.</p>"},{"title":"App#envVars","link":"<a href=\"App.html#envVars\">envVars</a>","description":"<p>Environment variables. Support dotenv (<code>.env</code>) file too!</p>\n<ul>\n<li>Underscore (<code>_</code>) translates key to camel-cased one</li>\n<li>Double underscores (<code>__</code>) breaks the key into object keys</li>\n<li>While dot (<code>.</code>) is used as namespace separator. If no namespace found, it is saved under <code>_</code> key.</li>\n</ul>\n<p>Values are also parsed automatically using {@link https://github.com/ladjs/dotenv-parse-variables|dotenv-parse-variables}.</p>\n<p>Example:</p>\n<ul>\n<li><code>MY_KEY=secret</code> → <code>{ _: { myKey: 'secret' } }</code></li>\n<li><code>MY_KEY__SUB_KEY=supersecret</code> → <code>{ _: { myKey: { subKey: 'supersecret' } } }</code></li>\n<li><code>MY_NS.MY_NAME=John</code> → <code>{ myNs: { myName: 'John' } }</code></li>\n</ul>"},{"title":"App#exit","link":"<a href=\"App.html#exit\">exit</a>","description":"<p>Terminate the app and back to console</p>"},{"title":"App#getAllNs","link":"<a href=\"App.html#getAllNs\">getAllNs</a>","description":"<p>Get all loaded plugin namesspaces</p>"},{"title":"App#getConfigFormats","link":"<a href=\"App.html#getConfigFormats\">getConfigFormats</a>","description":"<p>Helper method to list all supported config formats</p>"},{"title":"App#lib","link":"<a href=\"App.html#lib\">lib</a>","description":"<p>Gives you direct access to the most commonly used 3rd party library in a Bajo based app.\nNo manual import necessary, always available, anywhere, anytime!</p>\n<p>Example:</p>\n<pre class=\"prettyprint source lang-javascript\"><code>const { camelCase, kebabCase } = this.app.lib._\nconsole.log(camelCase('Elit commodo sit et aliqua'))\n</code></pre>"},{"title":"App#loadIntl","link":"<a href=\"App.html#loadIntl\">loadIntl</a>","description":"<p>Load internationalization & languages files for particular plugin</p>"},{"title":"App#log","link":"<a href=\"App.html#log\">log</a>","description":"<p>Instance of system log</p>"},{"title":"App#pluginClass","link":"<a href=\"App.html#pluginClass\">pluginClass</a>","description":"<p>All plugin's class definitions are saved here as key-value pairs with plugin name as its key.\nThe special key <code>base</code> is for {@link Base}'s class so anytime you want to\ncreate your own plugin, just use something like this:</p>\n<pre class=\"prettyprint source lang-javascript\"><code>class MyPlugin extends this.app.pluginClass.base {\n ... your class\n}</code></pre>"},{"title":"App#pluginPkgs","link":"<a href=\"App.html#pluginPkgs\">pluginPkgs</a>","description":"<p>List of all loaded plugin's package names</p>"},{"title":"App#runAt","link":"<a href=\"App.html#runAt\">runAt</a>","description":"<p>Date/time when your app start</p>"},{"title":"App#t","link":"<a href=\"App.html#t\">t</a>","description":"<p>Translate text and interpolate with given <code>args</code>.</p>\n<p>There is a shortcut to this method attached on all plugins. You'll normally call that shorcut\ninstead of this method, because it is bound to plugin's name already</p>\n<pre class=\"prettyprint source lang-javascript\"><code>... within your main plugin\nconst translated = this.app.t('main', 'My cute cat is %s', 'purring')\n// or\nconst translated = this.t('My cute cat is %s', 'purring')\n</code></pre>"},{"title":"App.envs","link":"<a href=\"App.html#.envs\">envs</a>","description":"<p>App environments</p>"},{"title":"App.mainNs","link":"<a href=\"App.html#.mainNs\">mainNs</a>","description":"<p>Your main namespace. And yes, you suppose to NOT CHANGE this</p>"},{"title":"Bajo","link":"<a href=\"Bajo.html\">Bajo</a>"},{"title":"Bajo#breakNsPath","link":"<a href=\"Bajo.html#breakNsPath\">breakNsPath</a>","description":"<p>Break name to its namespace & path infos</p>"},{"title":"Bajo#buildCollections","link":"<a href=\"Bajo.html#buildCollections\">buildCollections</a>","description":"<p>Method to transform config's array or object into an array of collection.</p>"},{"title":"Bajo#buildNsPath","link":"<a href=\"Bajo.html#buildNsPath\">buildNsPath</a>","description":"<p>Build ns/path pairs</p>"},{"title":"Bajo#callHandler","link":"<a href=\"Bajo.html#callHandler\">callHandler</a>","description":"<p>Calling any plugin's method by its name:</p>\n<ul>\n<li>If name is a string, the corresponding plugin's method will be called with passed args as its parameters</li>\n<li>If name is a plugin instance, this will be used as the scope instead. The first args is now the handler name and the rest are its parameters</li>\n<li>If name is a function, this function will be run under scope with the remaining args</li>\n<li>If name is an object and has <code>handler</code> key in it, this function handler will be instead</li>\n</ul>"},{"title":"Bajo#config","link":"<a href=\"Bajo.html#config\">config</a>","description":"<p>Config object</p>"},{"title":"Bajo#eachPlugins","link":"<a href=\"Bajo.html#eachPlugins\">eachPlugins</a>","description":"<p>This function iterates through all loaded plugins and call the provided handler scoped as the running plugin.\nAnd an object with the following key serves as its parameter:</p>\n<ul>\n<li><code>file</code>: file matched the glob pattern</li>\n<li><code>dir</code>: plugin's base directory</li>\n</ul>"},{"title":"Bajo#findDeep","link":"<a href=\"Bajo.html#findDeep\">findDeep</a>","description":"<p>Find item deep in paths</p>"},{"title":"Bajo#format","link":"<a href=\"Bajo.html#format\">format</a>","description":"<p>Format value</p>"},{"title":"Bajo#formatByType","link":"<a href=\"Bajo.html#formatByType\">formatByType</a>","description":"<p>Format value by type</p>"},{"title":"Bajo#freeze","link":"<a href=\"Bajo.html#freeze\">freeze</a>","description":"<p>Freeze object</p>"},{"title":"Bajo#generateId","link":"<a href=\"Bajo.html#generateId\">generateId</a>","description":"<p>Generate unique random characters that can be used as ID. Use {@link https://github.com/ai/nanoid|nanoid} under the hood</p>"},{"title":"Bajo#getGlobalModuleDir","link":"<a href=\"Bajo.html#getGlobalModuleDir\">getGlobalModuleDir</a>","description":"<p>Get NPM global module directory</p>"},{"title":"Bajo#getMethod","link":"<a href=\"Bajo.html#getMethod\">getMethod</a>","description":"<p>Get class method by name</p>"},{"title":"Bajo#getModuleDir","link":"<a href=\"Bajo.html#getModuleDir\">getModuleDir</a>","description":"<p>Get module directory, locally and globally</p>"},{"title":"Bajo#getPlugin","link":"<a href=\"Bajo.html#getPlugin\">getPlugin</a>","description":"<p>Get plugin by name</p>"},{"title":"Bajo#getPluginDataDir","link":"<a href=\"Bajo.html#getPluginDataDir\">getPluginDataDir</a>","description":"<p>Get plugin data directory</p>"},{"title":"Bajo#getPluginFile","link":"<a href=\"Bajo.html#getPluginFile\">getPluginFile</a>","description":"<p>Resolve file path from:</p>\n<ul>\n<li>local/absolute file</li>\n<li>TNsPath (<code>myPlugin:/path/to/file.txt</code>)</li>\n</ul>"},{"title":"Bajo#getUnitFormat","link":"<a href=\"Bajo.html#getUnitFormat\">getUnitFormat</a>","description":"<p>Get unit format</p>"},{"title":"Bajo#importModule","link":"<a href=\"Bajo.html#importModule\">importModule</a>","description":"<p>Import file/module from any loaded plugins.</p>\n<p>Method proxy from {@link module:Lib.importModule}</p>"},{"title":"Bajo#importPkg","link":"<a href=\"Bajo.html#importPkg\">importPkg</a>","description":"<p>Import one or more packages belongs to a plugin.</p>\n<p>If the last arguments passed is an object, this object serves as options object:</p>\n<ul>\n<li><code>returnDefault</code>: should return package's default export. Defaults to <code>true</code></li>\n<li><code>throwNotFound</code>: should throw if package is not found. Defaults to <code>false</code></li>\n<li><code>noCache</code>: always use fresh import. Defaults to <code>false</code></li>\n<li><code>asObject</code>: see below. Defaults to <code>false</code></li>\n</ul>\n<p>Return value:</p>\n<ul>\n<li>if <code>options.asObject</code> is <code>true</code> (default <code>false</code>), return as object with package's names as it's keys</li>\n<li>Otherwise depends on how many parameters are provided, it should return the named package or an array of packages</li>\n</ul>\n<p>Example: you want to import <code>delay</code> and <code>chalk</code> from <code>bajo</code> plugin because you want to use it in your code</p>\n<pre class=\"prettyprint source lang-javascript\"><code>const { importPkg } from this.app.bajo\nconst [delay, chalk] = await importPkg('bajo:delay', 'bajo:chalk')\n\nawait delay(1000)\n...\n</code></pre>"},{"title":"Bajo#init","link":"<a href=\"Bajo.html#init\">init</a>","description":"<p>Initialization:</p>\n<ol>\n<li>Building {@link module:Helper/Bajo.buildBaseConfig|base config}</li>\n<li>{@link module:Helper/Bajo.buildPlugins|Building plugins}</li>\n<li>Collect all {@link module:Helper/Bajo.collectConfigHandlers|config handler}</li>\n<li>Building {@link module:Helper/Bajo.buildExtConfig|extra config}</li>\n<li>Setup {@link module:Helper/Bajo.bootOrder|boot order}</li>\n<li>{@link module:Helper/Bajo.bootPlugins|Boot loaded plugins}</li>\n<li>Attach {@link module:Helper/Bajo.exitHandler|exit handlers}</li>\n</ol>"},{"title":"Bajo#isEmptyDir","link":"<a href=\"Bajo.html#isEmptyDir\">isEmptyDir</a>","description":"<p>Check whether a directory is empty or not. More info please {@link https://github.com/gulpjs/empty-dir|check here}.</p>"},{"title":"Bajo#isLogInRange","link":"<a href=\"Bajo.html#isLogInRange\">isLogInRange</a>","description":"<p>Check whether log level is within log's app current level</p>"},{"title":"Bajo#isValidApp","link":"<a href=\"Bajo.html#isValidApp\">isValidApp</a>","description":"<p>Check whether directory is a valid Bajo app</p>"},{"title":"Bajo#isValidPlugin","link":"<a href=\"Bajo.html#isValidPlugin\">isValidPlugin</a>","description":"<p>Check whether directory is a valid Bajo plugin</p>"},{"title":"Bajo#join","link":"<a href=\"Bajo.html#join\">join</a>","description":"<p>Human friendly join array of items.</p>"},{"title":"Bajo#numUnit","link":"<a href=\"Bajo.html#numUnit\">numUnit</a>","description":"<p>Return its numeric portion of a value</p>"},{"title":"Bajo#parseDt","link":"<a href=\"Bajo.html#parseDt\">parseDt</a>","description":"<p>Parse datetime string as Javascript date object. Please visit {@link https://day.js.org|dayjs} for valid formats and more infos</p>"},{"title":"Bajo#parseDur","link":"<a href=\"Bajo.html#parseDur\">parseDur</a>","description":"<p>Parse duration to its millisecond value. Use {@link https://github.com/vercel/ms|ms} under the hood</p>"},{"title":"Bajo#parseObject","link":"<a href=\"Bajo.html#parseObject\">parseObject</a>","description":"<p>Parse an object and optionally normalize its values recursively. Use {@link https://github.com/ladjs/dotenv-parse-variables}\nto parse values, so please have a visit to know how it works</p>\n<p>If <code>options.parseValue</code> is <code>true</code>, any key ends with <code>Dur</code> and <code>Dt</code> will\nalso be parsed as millisecond and Javascript date time accordingly.</p>"},{"title":"Bajo#readAllConfigs","link":"<a href=\"Bajo.html#readAllConfigs\">readAllConfigs</a>","description":"<p>Read all config files by path</p>"},{"title":"Bajo#readConfig","link":"<a href=\"Bajo.html#readConfig\">readConfig</a>","description":"<p>Read and parse file as config object. Supported types: <code>.js</code> and <code>.json</code>.\nMore supports can be added using plugin. {@link https://github.com/ardhi/bajo-config|bajo-config} gives you additional supports for <code>.yml</code>, <code>.yaml</code> and <code>.toml</code> file</p>\n<p>If file extension is <code>.*</code>, it will be auto detected and parsed accordingly</p>"},{"title":"Bajo#readJson","link":"<a href=\"Bajo.html#readJson\">readJson</a>","description":"<p>Read and parse json file</p>"},{"title":"Bajo#resolvePath","link":"<a href=\"Bajo.html#resolvePath\">resolvePath</a>","description":"<p>Resolve file name to filesystem's path. Windows path separator <code>\\</code>\nis normalized to Unix's <code>/</code></p>"},{"title":"Bajo#runHook","link":"<a href=\"Bajo.html#runHook\">runHook</a>","description":"<p>Run named hook/event</p>"},{"title":"Bajo#saveAsDownload","link":"<a href=\"Bajo.html#saveAsDownload\">saveAsDownload</a>","description":"<p>Save item as file in Bajo's download directory. That is a directory inside your\nBajo plugin's data directory.</p>\n<p>If file exists already, file will automatically be\nrenamed incrementally.</p>"},{"title":"Base","link":"<a href=\"Base.html\">Base</a>"},{"title":"Base#exit","link":"<a href=\"Base.html#exit\">exit</a>","description":"<p>Upon app termination, this method will be called first. Mostly useful for system cleanup,\ndelete temporary files, freeing resources etc.</p>"},{"title":"Base#init","link":"<a href=\"Base.html#init\">init</a>","description":"<p>After config is read, plugin will be initialized. You can still change your config here,\nbecause after plugin is initialized, config will be deep frozen.</p>"},{"title":"Base#loadConfig","link":"<a href=\"Base.html#loadConfig\">loadConfig</a>","description":"<p>Load config from file in data directory, program arguments and environment variables. Level of importance:\n<code>Env Variables > Program Arguments > Config File</code></p>"},{"title":"Base#start","link":"<a href=\"Base.html#start\">start</a>","description":"<p>This method will be called after plugin's init</p>"},{"title":"Base.dependencies","link":"<a href=\"Base.html#.dependencies\">dependencies</a>","description":"<p>Dependencies to other plugins. Enter all plugin's package name your plugin dependent from.</p>\n<p>Semver is also supported.</p>"},{"title":"Err","link":"<a href=\"Err.html\">Err</a>"},{"title":"Err#app","link":"<a href=\"Err.html#app\">app</a>","description":"<p>The app instance</p>"},{"title":"Err#fatal","link":"<a href=\"Err.html#fatal\">fatal</a>","description":"<p>Print instance on console and terminate process</p>"},{"title":"Err#formatErrorDetails","link":"<a href=\"Err.html#formatErrorDetails\">formatErrorDetails</a>","description":"<p>Pretty format error details</p>"},{"title":"Err#message","link":"<a href=\"Err.html#message\">message</a>","description":"<p>Translated message</p>"},{"title":"Err#orgMessage","link":"<a href=\"Err.html#orgMessage\">orgMessage</a>","description":"<p>Original message before translation</p>"},{"title":"Err#payload","link":"<a href=\"Err.html#payload\">payload</a>","description":"<p>Error payload extracted from the last arguments</p>"},{"title":"Err#plugin","link":"<a href=\"Err.html#plugin\">plugin</a>","description":"<p>Attached plugin</p>"},{"title":"Err#write","link":"<a href=\"Err.html#write\">write</a>","description":"<p>Write message to the console</p>"},{"title":"Log","link":"<a href=\"Log.html\">Log</a>"},{"title":"Log#app","link":"<a href=\"Log.html#app\">app</a>","description":"<p>The app instance</p>"},{"title":"Log#debug","link":"<a href=\"Log.html#debug\">debug</a>","description":"<p>Display & format message in <code>debug</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Log#error","link":"<a href=\"Log.html#error\">error</a>","description":"<p>Display & format message in <code>error</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Log#fatal","link":"<a href=\"Log.html#fatal\">fatal</a>","description":"<p>Display & format message in <code>fatal</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Log#formatMsg","link":"<a href=\"Log.html#formatMsg\">formatMsg</a>","description":"<p>Display & format message according to one of these rules:</p>\n<ol>\n<li><code>level</code> <code>prefix</code> <code>text</code> <code>var 1</code> <code>var 2</code> <code>...var n</code> - Translate <code>text</code> and interpolate with <code>vars</code> for level <code>level</code></li>\n<li><code>level</code> <code>prefix</code> <code>data</code> <code>text</code> <code>var 1</code> <code>var 2</code> <code>...var n</code> - As above, and append stringified <code>data</code></li>\n<li><code>level</code> <code>prefix</code> <code>error</code> - Format as {@link Err} object. If current log level is <em>trace</em>, dump it on screen</li>\n</ol>\n<p>In <code>prod</code> environment, log will be delivered as JSON stringified object. See {@link TLogJson} for more info</p>"},{"title":"Log#info","link":"<a href=\"Log.html#info\">info</a>","description":"<p>Display & format message in <code>info</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Log#silent","link":"<a href=\"Log.html#silent\">silent</a>","description":"<p>Display & format message in <code>silent</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Log#trace","link":"<a href=\"Log.html#trace\">trace</a>","description":"<p>Display & format message in <code>trace</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Log#warn","link":"<a href=\"Log.html#warn\">warn</a>","description":"<p>Display & format message in <code>warn</code> level. See {@link Log#formatMsg|formatMsg} for details</p>"},{"title":"Plugin","link":"<a href=\"Plugin.html\">Plugin</a>"},{"title":"Plugin#alias","link":"<a href=\"Plugin.html#alias\">alias</a>","description":"<p>Getter for plugin's alias</p>"},{"title":"Plugin#app","link":"<a href=\"Plugin.html#app\">app</a>","description":"<p>Reference to app instance</p>"},{"title":"Plugin#config","link":"<a href=\"Plugin.html#config\">config</a>","description":"<p>Config object</p>"},{"title":"Plugin#error","link":"<a href=\"Plugin.html#error\">error</a>","description":"<p>Create an instance of {@link Err} object</p>"},{"title":"Plugin#fatal","link":"<a href=\"Plugin.html#fatal\">fatal</a>","description":"<p>Create an instance of Err object, display it on screen and then force\nterminate the app process</p>"},{"title":"Plugin#getConfig","link":"<a href=\"Plugin.html#getConfig\">getConfig</a>","description":"<p>Get plugin's config value</p>"},{"title":"Plugin#log","link":"<a href=\"Plugin.html#log\">log</a>","description":"<p>Shortcut to {@link App#log} with prefix parameter set to this plugin name.</p>"},{"title":"Plugin#ns","link":"<a href=\"Plugin.html#ns\">ns</a>","description":"<p>Getter for plugin's ns</p>"},{"title":"Plugin#pkgName","link":"<a href=\"Plugin.html#pkgName\">pkgName</a>","description":"<p>Getter for plugin's package name</p>"},{"title":"Plugin#t","link":"<a href=\"Plugin.html#t\">t</a>","description":"<p>Translate text and interpolate with given <code>args</code>.</p>\n<p>Shortcut to {@link App#t} with ns parameter set to this plugin namespace.</p>"},{"title":"Plugin.alias","link":"<a href=\"Plugin.html#.alias\">alias</a>","description":"<p>Plugin alias. Derived plugin must provide its own, unique alias. If it left blank,\nBajo will provide this automatically (by using the kebab-cased version of plugin name)</p>"},{"title":"Plugin.ns","link":"<a href=\"Plugin.html#.ns\">ns</a>","description":"<p>Namespace (ns) or plugin's name. Simply the camel cased version of plugin's package name</p>"},{"title":"Plugin.pkgName","link":"<a href=\"Plugin.html#.pkgName\">pkgName</a>","description":"<p>Package name, the one from package.json</p>"},{"title":"Print","link":"<a href=\"Print.html\">Print</a>"},{"title":"Print#app","link":"<a href=\"Print.html#app\">app</a>","description":"<p>The app instance</p>"},{"title":"Print#buildText","link":"<a href=\"Print.html#buildText\">buildText</a>","description":"<p>Translate, prefixed with counter and/or datetime etc</p>"},{"title":"Print#clear","link":"<a href=\"Print.html#clear\">clear</a>","description":"<p>Clear spinner text</p>"},{"title":"Print#fail","link":"<a href=\"Print.html#fail\">fail</a>","description":"<p>Print failed message, prefixed with a cross icon</p>"},{"title":"Print#fatal","link":"<a href=\"Print.html#fatal\">fatal</a>","description":"<p>Print failed message, prefixed with a cross icon and exit</p>"},{"title":"Print#getElapsed","link":"<a href=\"Print.html#getElapsed\">getElapsed</a>","description":"<p>Get elapsed time since instance is created</p>"},{"title":"Print#info","link":"<a href=\"Print.html#info\">info</a>","description":"<p>Print information message, prefixed with an info icon</p>"},{"title":"Print#options","link":"<a href=\"Print.html#options\">options</a>","description":"<p>Options object</p>"},{"title":"Print#ora","link":"<a href=\"Print.html#ora\">ora</a>","description":"<p>ora instance</p>"},{"title":"Print#plugin","link":"<a href=\"Print.html#plugin\">plugin</a>","description":"<p>Attached plugin</p>"},{"title":"Print#render","link":"<a href=\"Print.html#render\">render</a>","description":"<p>Force render spinner</p>"},{"title":"Print#setOpts","link":"<a href=\"Print.html#setOpts\">setOpts</a>","description":"<p>Setting spinner options; override the one passed at constructor</p>"},{"title":"Print#setText","link":"<a href=\"Print.html#setText\">setText</a>","description":"<p>Set spinner's text</p>"},{"title":"Print#spinner","link":"<a href=\"Print.html#spinner\">spinner</a>","description":"<p>Create a new print instance</p>"},{"title":"Print#start","link":"<a href=\"Print.html#start\">start</a>","description":"<p>Start the spinner</p>"},{"title":"Print#startTime","link":"<a href=\"Print.html#startTime\">startTime</a>","description":"<p>Time when instance is created</p>"},{"title":"Print#stop","link":"<a href=\"Print.html#stop\">stop</a>","description":"<p>Stop the spinner</p>"},{"title":"Print#succeed","link":"<a href=\"Print.html#succeed\">succeed</a>","description":"<p>Print success message, prefixed with a check icon</p>"},{"title":"Print#warn","link":"<a href=\"Print.html#warn\">warn</a>","description":"<p>Print warning message, prefixed with a warn icon</p>"},{"title":"TAppConfigHandler","link":"<a href=\"global.html#TAppConfigHandler\">TAppConfigHandler</a>"},{"title":"TAppEnv","link":"<a href=\"global.html#TAppEnv\">TAppEnv</a>"},{"title":"TAppLib","link":"<a href=\"global.html#TAppLib\">TAppLib</a>"},{"title":"TBajoDataType","link":"<a href=\"global.html#TBajoDataType\">TBajoDataType</a>","description":"<p>Supported data types</p>"},{"title":"TBajoFormatResult","link":"<a href=\"global.html#TBajoFormatResult\">TBajoFormatResult</a>","description":"<p>Object returned by {@link Bajo#getUnitFormat|bajo:getUnitFormat}</p>"},{"title":"TBajoFormatType","link":"<a href=\"global.html#TBajoFormatType\">TBajoFormatType</a>","description":"<p>General format types</p>"},{"title":"TLogJson","link":"<a href=\"global.html#TLogJson\">TLogJson</a>","description":"<p>Log output in stringified JSON format. Returned when app run in <code>prod</code> environment</p>"},{"title":"TLogLevels","link":"<a href=\"global.html#TLogLevels\">TLogLevels</a>"},{"title":"TNsPathPairs","link":"<a href=\"global.html#TNsPathPairs\">TNsPathPairs</a>","description":"<p>Name based <code>{ns}:{path}</code> format</p>"},{"title":"TNsPathResult","link":"<a href=\"global.html#TNsPathResult\">TNsPathResult</a>","description":"<p>Object returned by {@link Bajo#breakNsPath|bajo:breakNsPath}</p>"},{"title":"TPrintOptions","link":"<a href=\"global.html#TPrintOptions\">TPrintOptions</a>"},{"title":"bajo:afterAll{method}","link":"<a href=\"global.html#event:bajo:afterAll%257Bmethod%257D\">bajo:afterAll{method}</a>","description":"<p>Run after all <code>{method}</code> executed. Accepted <code>{method}</code>: <code>Init</code> or <code>Start</code></p>"},{"title":"bajo:afterBootComplete","link":"<a href=\"global.html#event:bajo:afterBootComplete\">bajo:afterBootComplete</a>","description":"<p>Run after boot process is completed</p>"},{"title":"bajo:afterBuildCollection","link":"<a href=\"global.html#event:bajo:afterBuildCollection\">bajo:afterBuildCollection</a>","description":"<p>Run after collection is built</p>"},{"title":"bajo:afterCollectHooks","link":"<a href=\"global.html#event:bajo:afterCollectHooks\">bajo:afterCollectHooks</a>","description":"<p>Run after hooks are collected</p>"},{"title":"bajo:beforeAll{method}","link":"<a href=\"global.html#event:bajo:beforeAll%257Bmethod%257D\">bajo:beforeAll{method}</a>","description":"<p>Run before all <code>{method}</code> executed. Accepted <code>{method}</code>: <code>Init</code> or <code>Start</code></p>"},{"title":"bajo:beforeBuildCollection","link":"<a href=\"global.html#event:bajo:beforeBuildCollection\">bajo:beforeBuildCollection</a>","description":"<p>Run before collection is built</p>"},{"title":"boot","link":"<a href=\"global.html#boot\">boot</a>","description":"<p>Main entry point of a Bajo app. Returned value is the app instance itself.</p>\n<p>While you can code directly around it, you typically write your code the main plugin (<code>{mainNs}</code>) or\nwriting your own custom plugin.</p>\n<p>I recommend the second method for its portability.</p>\n<p>Example:</p>\n<pre class=\"prettyprint source lang-javascript\"><code>// index.js file. Your main package entry point\nimport bajo from 'bajo'\nawait bajo()\n</code></pre>"},{"title":"event:{ns}:afterAppletRun","link":"<a href=\"global.html#event:%257Bns%257D:afterAppletRun\">{ns}:afterAppletRun</a>","description":"<p>Run after applet is run. <code>[ns]</code> is applet's namespace</p>"},{"title":"event:{ns}:after{method}","link":"<a href=\"global.html#event:%257Bns%257D:after%257Bmethod%257D\">{ns}:after{method}</a>","description":"<p>Run after <code>{method}</code> is executed within <code>{ns}</code> context</p>\n<ul>\n<li><code>{ns}</code> - namespace</li>\n<li><code>{method}</code> - Accepted methods: <code>Init</code> or <code>Start</code></li>\n</ul>"},{"title":"event:{ns}:beforeAppletRun","link":"<a href=\"global.html#event:%257Bns%257D:beforeAppletRun\">{ns}:beforeAppletRun</a>","description":"<p>Run before applet is run. <code>[ns]</code> is applet's namespace</p>"},{"title":"event:{ns}:before{method}","link":"<a href=\"global.html#event:%257Bns%257D:before%257Bmethod%257D\">{ns}:before{method}</a>","description":"<p>Run before <code>{method}</code> is executed within <code>{ns}</code> context</p>\n<ul>\n<li><code>{ns}</code> - namespace</li>\n<li><code>{method}</code> - Accepted methods: <code>Init</code> or <code>Start</code></li>\n</ul>"},{"title":"module:Helper/Bajo","link":"<a href=\"module-Helper_Bajo.html\">Helper/Bajo</a>","description":"<p>Internal helpers called by Bajo that only used once for bootstrapping. It should remains\nhidden and not to be imported by any program.</p>"},{"title":"module:Helper/Bajo.bootOrder","link":"<a href=\"module-Helper_Bajo.html#.bootOrder\">bootOrder</a>","description":"<p>Setup plugins boot orders by reading plugin's <code>.bootorder</code> file if provided.</p>"},{"title":"module:Helper/Bajo.bootPlugins","link":"<a href=\"module-Helper_Bajo.html#.bootPlugins\">bootPlugins</a>","description":"<p>Iterate through all plugins loaded and do:</p>\n<ol>\n<li>{@link module:Helper/Base.buildConfigs|build configs}</li>\n<li>{@link module:Helper/Base.checkNameAliases|ensure names & aliases uniqueness}</li>\n<li>{@link module:Helper/Base.checkDependencies|ensure dependencies are met}</li>\n<li>{@link module:Helper/Base.attachMethods|build and attach dynamic methods}</li>\n<li>{@link module:Helper/Base.collectHooks|collect hooks}</li>\n<li>{@link module:Helper/Base.run|run plugins}</li>\n</ol>"},{"title":"module:Helper/Bajo.buildBaseConfig","link":"<a href=\"module-Helper_Bajo.html#.buildBaseConfig\">buildBaseConfig</a>","description":"<p>Building bajo base config. Mostly dealing with directory setups:</p>\n<ul>\n<li>determine base directory</li>\n<li>check whether data directory is valid. If not exist, create one inside app dir</li>\n<li>ensure data config directory is there</li>\n<li>ensure tmp dir is there</li>\n<li>read the list of plugins from <code>.plugins</code> file</li>\n</ul>"},{"title":"module:Helper/Bajo.buildExtConfig","link":"<a href=\"module-Helper_Bajo.html#.buildExtConfig\">buildExtConfig</a>","description":"<p>Bajo extra config:</p>\n<ul>\n<li>reading config file</li>\n<li>merge config with arguments & environments values</li>\n<li>Set environment (<code>dev</code> or <code>prod</code>)</li>\n</ul>"},{"title":"module:Helper/Bajo.buildPlugins","link":"<a href=\"module-Helper_Bajo.html#.buildPlugins\">buildPlugins</a>","description":"<p>Building all plugins:</p>\n<ul>\n<li>load from app's pluginPkgs</li>\n<li>iterate through the list and build related plugins</li>\n<li>making sure main plugin is there. If not, create from template</li>\n<li>attach these plugins to the app instance</li>\n</ul>"},{"title":"module:Helper/Bajo.collectConfigHandlers","link":"<a href=\"module-Helper_Bajo.html#.collectConfigHandlers\">collectConfigHandlers</a>","description":"<p>Collect all config handlers, including the one provided by plugins</p>"},{"title":"module:Helper/Bajo.exitHandler","link":"<a href=\"module-Helper_Bajo.html#.exitHandler\">exitHandler</a>","description":"<p>Attach plugins exit handlers and make sure the app shutdowns gracefully</p>"},{"title":"module:Helper/Bajo.runAsApplet","link":"<a href=\"module-Helper_Bajo.html#.runAsApplet\">runAsApplet</a>","description":"<p>If app is in <code>applet</code> mode, this little helper should take care plugin's applet boot process</p>"},{"title":"module:Helper/Base","link":"<a href=\"module-Helper_Base.html\">Helper/Base</a>","description":"<p>Internal helpers called by Bajo & plugins that only used once for bootstrapping purpose.\nIt should remains hidden and not to be imported by any program.</p>"},{"title":"module:Helper/Base.attachMethods","link":"<a href=\"module-Helper_Base.html#.attachMethods\">attachMethods</a>","description":"<p>Scan plugins <code>method</code> directories, and turn + attach its found files as methods dynamically.</p>"},{"title":"module:Helper/Base.buildConfigs","link":"<a href=\"module-Helper_Base.html#.buildConfigs\">buildConfigs</a>","description":"<p>Build configurations</p>"},{"title":"module:Helper/Base.checkDependencies","link":"<a href=\"module-Helper_Base.html#.checkDependencies\">checkDependencies</a>","description":"<p>Ensure dependencies are met</p>"},{"title":"module:Helper/Base.checkNameAliases","link":"<a href=\"module-Helper_Base.html#.checkNameAliases\">checkNameAliases</a>","description":"<p>Ensure for names and aliases to be unique and no clashes with other plugins</p>"},{"title":"module:Helper/Base.collectHooks","link":"<a href=\"module-Helper_Base.html#.collectHooks\">collectHooks</a>","description":"<p>Collect and build hooks and push them to the bajo's hook system</p>"},{"title":"module:Helper/Base.run","link":"<a href=\"module-Helper_Base.html#.run\">run</a>","description":"<p>Finally, run all plugins</p>"},{"title":"module:Lib","link":"<a href=\"module-Lib.html\">Lib</a>","description":"<p>External helpers you can use by importing its file directly</p>"},{"title":"module:Lib.currentLoc","link":"<a href=\"module-Lib.html#.currentLoc\">currentLoc</a>","description":"<p>Get current directory & file. An attempt to brings back the old <code>__dirname</code> and <code>__filename</code>\nto the ES6 era.</p>\n<p>Returns object with the following keys:</p>\n<ul>\n<li><code>__dirname</code> (aliases to <code>dir</code>) - current directory name</li>\n<li><code>__filename</code> (aliases to <code>file</code>) - current file path</li>\n</ul>\n<p>Example:</p>\n<pre class=\"prettyprint source lang-javascript\"><code>const { importModule } = this.app.bajo\nconst currentLoc = await importModule('bajo:/lib/current-loc.js')\n\nconst { __dirname, __filename } = currentLoc(import.meta)\nconsole.log(__dirname, __filename)\n</code></pre>"},{"title":"module:Lib.importModule","link":"<a href=\"module-Lib.html#.importModule\">importModule</a>","description":"<p>Import file/module from any loaded plugins</p>\n<p>Example: your plugin structure looks like this</p>\n<pre class=\"prettyprint source\"><code>|- src\n| |- lib\n| | |- my-module.js\n|- index.js\n|- package.json\n</code></pre>\n<p>And now this is how to import <code>my-module.js</code>:</p>\n<pre class=\"prettyprint source lang-javascript\"><code>const { importModule } = this.app.bajo\nconst myModule = await importModule('myPlugin:/src/lib/my-module.js')\n</code></pre>"},{"title":"module:Lib.parseArgsArgv","link":"<a href=\"module-Lib.html#.parseArgsArgv\">parseArgsArgv</a>","description":"<p>Parse program arguments (args) & options (argv). See {@link App#args|args} & {@link App#argv|argv} for examples</p>"},{"title":"module:Lib.parseEnv","link":"<a href=\"module-Lib.html#.parseEnv\">parseEnv</a>","description":"<p>Parse environment variables. See {@link App#envVars|envVars} for examples</p>"},{"title":"module:Lib.resolvePath","link":"<a href=\"module-Lib.html#.resolvePath\">resolvePath</a>","description":"<p>Resolve file name to filesystem's path. Windows path separator <code>\\</code>\nis normalized to Unix's <code>/</code></p>"},{"title":"module:Lib.shim","link":"<a href=\"module-Lib.html#.shim\">shim</a>","description":"<p>Function to attach some of the methods needed but probably not provided by your node installation:</p>\n<ul>\n<li><code>String.prototype.replaceAll</code></li>\n<li><code>String.prototype.splice</code></li>\n</ul>"}]}