bajo 2.23.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsdoc.conf.json +2 -1
- package/class/app.js +220 -107
- package/class/bajo.js +246 -174
- package/class/base.js +85 -24
- package/class/cache.js +8 -16
- package/class/err.js +31 -10
- package/class/log.js +46 -38
- package/class/plugin.js +53 -30
- package/class/print.js +18 -15
- package/class/tools.js +6 -5
- package/docs/App.html +51 -1
- package/docs/Bajo.html +1 -1
- package/docs/Base.html +34 -1
- package/docs/Cache.html +1 -1
- package/docs/Err.html +2 -2
- package/docs/Log.html +2 -2
- package/docs/Main.html +3 -0
- package/docs/Plugin.html +1 -1
- package/docs/Print.html +1 -1
- package/docs/Tools.html +1 -1
- package/docs/class_app.js.html +222 -109
- package/docs/class_bajo.js.html +260 -179
- package/docs/class_base.js.html +87 -26
- package/docs/class_cache.js.html +10 -18
- package/docs/class_err.js.html +33 -12
- package/docs/class_log.js.html +48 -40
- package/docs/class_plugin.js.html +55 -32
- package/docs/class_print.js.html +20 -17
- package/docs/class_tools.js.html +8 -7
- package/docs/data/search.json +1 -1
- package/docs/extend_bajo_hook.js.html +289 -0
- package/docs/global.html +22 -1
- package/docs/index.html +1 -1
- package/docs/index.js.html +53 -16
- package/docs/lib_applet-hook.js.html +328 -0
- package/docs/lib_config.js.html +167 -0
- package/docs/lib_helper.js.html +186 -192
- package/docs/module-Applet.html +3 -0
- package/docs/module-Helper-Main.html +3 -0
- package/docs/module-Helper.html +1 -8
- package/docs/module-Hook.html +1 -1
- package/docs/tutorial-01_WELCOME.html +3 -0
- package/docs/tutorial-02_GETTING_STARTED.html +125 -0
- package/docs/tutorial-03_USER_GUIDE.html +54 -0
- package/docs/tutorial-04_DEV_GUIDE.html +178 -0
- package/docs/tutorial-05_ECOSYSTEM.html +3 -0
- package/extend/bajo/intl/en-US.json +2 -1
- package/extend/bajo/intl/id.json +2 -1
- package/index.js +51 -14
- package/lib/applet-hook.js +325 -0
- package/lib/config.js +164 -0
- package/lib/helper.js +184 -190
- package/package.json +6 -2
- package/test/00-global-hooks.test.js +44 -0
- package/test/e2e/_run.js +19 -0
- package/test/e2e/e2e-applet-process.test.js +66 -0
- package/test/e2e/e2e-boot-process.test.js +62 -0
- package/test/e2e/e2e-hooks-process.test.js +68 -0
- package/test/integration/_setup.js +55 -0
- package/test/integration/aspect-01-boot-instance.test.js +24 -0
- package/test/integration/aspect-02-plugin-loading.test.js +24 -0
- package/test/integration/aspect-03-config-merge.test.js +27 -0
- package/test/integration/aspect-04-intl-loading.test.js +29 -0
- package/test/integration/aspect-05-cache-roundtrip.test.js +26 -0
- package/test/integration/aspect-06-log-file-save.test.js +28 -0
- package/test/integration/aspect-07-plugin-data-dir.test.js +25 -0
- package/test/integration/aspect-08-plugin-lookup.test.js +25 -0
- package/test/integration/aspect-09-config-formats.test.js +26 -0
- package/test/integration/aspect-10-hooks.test.js +38 -0
- package/test/unit/app.test.js +115 -0
- package/test/unit/applet-hook.test.js +10 -0
- package/test/unit/bajo.test.js +151 -0
- package/test/unit/base.test.js +90 -0
- package/test/unit/cache.test.js +89 -0
- package/test/unit/config.test.js +14 -0
- package/test/unit/err.test.js +57 -0
- package/test/unit/helper.test.js +116 -0
- package/test/unit/index.test.js +40 -0
- package/test/unit/log.test.js +84 -0
- package/test/unit/plugin.test.js +95 -0
- package/test/unit/print.test.js +72 -0
- package/test/unit/tools.test.js +29 -0
- package/wiki/CHANGES.md +4 -0
- package/wiki/tutorials/01_WELCOME.md +18 -0
- package/wiki/tutorials/02_GETTING_STARTED.md +366 -0
- package/wiki/tutorials/03_USER_GUIDE.md +262 -0
- package/wiki/tutorials/04_DEV_GUIDE.md +386 -0
- package/wiki/tutorials/05_ECOSYSTEM.md +95 -0
- package/wiki/tutorials/tutorials.json +17 -0
- package/lib/hook.js +0 -228
- package/test/app.test.js +0 -183
- package/test/bajo.test.js +0 -124
- package/test/base.test.js +0 -75
- package/test/cache.test.js +0 -94
- package/test/e2e.test.js +0 -137
- package/test/err.test.js +0 -73
- package/test/helper.test.js +0 -39
- package/test/import-module.test.js +0 -138
- package/test/integration.test.js +0 -218
- package/test/log.test.js +0 -119
- package/test/plugin.test.js +0 -116
- package/test/print.test.js +0 -100
- package/test/tools.test.js +0 -38
- package/wiki/CONFIG.md +0 -36
- package/wiki/DEV_GUIDE.md +0 -3
- package/wiki/ECOSYSTEM.md +0 -93
- package/wiki/GETTING-STARTED.md +0 -356
- package/wiki/USER-GUIDE.md +0 -256
package/docs/module-Hook.html
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Module: Hook</title><!--[if lt IE 9]>
|
|
2
2
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
3
|
-
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="light"><div class="sidebar-container"><div class="sidebar" id="sidebar"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header></header><article><div class="container-overview"><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line1">line 1</a></li></ul></dd></div></dl></div><h2 id="methods" class="subsection-title has-anchor">Methods</h2><h3 class="name has-anchor" id="~bajo:afterAllInit"><span class="type-signature">(async, inner) </span>bajo:afterAllInit<span class="signature">()</span></h3><div class="description"><p>Run after all plugins are initialized. You can use this hook to do some post-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line52">line 52</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:afterAllStart"><span class="type-signature">(async, inner) </span>bajo:afterAllStart<span class="signature">()</span></h3><div class="description"><p>Run after all plugins are started. You can use this hook to do some post-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line70">line 70</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:afterBoot"><span class="type-signature">(async, inner) </span>bajo:afterBoot<span class="signature">()</span></h3><div class="description"><p>Run after boot process. You can use this hook to do some post-boot process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line24">line 24</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:afterBuildCollection"><span class="type-signature">(async, inner) </span>bajo:afterBuildCollection<span class="signature">(container, items)</span></h3><div class="description"><p>Run after collection is built.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>container</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Collection container name</p></td></tr><tr><td class="name"><code>items</code></td><td class="type"><span class="param-type">array.<object></span></td><td class="description last"><p>Collection items</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line145">line 145</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Bajo.html#buildCollections">Bajo#buildCollections</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:afterCollectHooks"><span class="type-signature">(async, inner) </span>bajo:afterCollectHooks<span class="signature">(hooks)</span></h3><div class="description"><p>Run after hooks are collected. You can use this hook to modify the collected hooks before they are recognized as application hooks.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>hooks</code></td><td class="type"><span class="param-type">Array.<<a href="module-Hook.html#~THook">module:Hook~THook</a>></span></td><td class="description last"><p>Array of hook objects</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line32">line 32</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.collectHooks">module:Helper.collectHooks</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:afterReadConfig"><span class="type-signature">(async, inner) </span>bajo:afterReadConfig<span class="signature">(file, result, options)</span></h3><div class="description"><p>Run after all read processes of a configuration file are completed.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>file</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file path</p></td></tr><tr><td class="name"><code>result</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>Resulting config object after parsing</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line219">line 219</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:beforeAllInit"><span class="type-signature">(async, inner) </span>bajo:beforeAllInit<span class="signature">()</span></h3><div class="description"><p>Run before all plugins are initialized. You can use this hook to do some pre-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line43">line 43</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:beforeAllStart"><span class="type-signature">(async, inner) </span>bajo:beforeAllStart<span class="signature">()</span></h3><div class="description"><p>Run before all plugins are started. You can use this hook to do some pre-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line61">line 61</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:beforeBoot"><span class="type-signature">(async, inner) </span>bajo:beforeBoot<span class="signature">()</span></h3><div class="description"><p>Run before boot process. You can use this hook to do some pre-boot process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line16">line 16</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:beforeBuildCollection"><span class="type-signature">(async, inner) </span>bajo:beforeBuildCollection<span class="signature">(container)</span></h3><div class="description"><p>Run before collection is built.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>container</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Collection container name</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line135">line 135</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Bajo.html#buildCollections">Bajo#buildCollections</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~bajo:beforeReadConfig"><span class="type-signature">(async, inner) </span>bajo:beforeReadConfig<span class="signature">(file, options)</span></h3><div class="description"><p>Run before a configuration file is read.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>file</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file path</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line209">line 209</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~%7Bns%7D:afterAppletRun"><span class="type-signature">(async, inner) </span>{ns}:afterAppletRun<span class="signature">(…args)</span></h3><div class="description"><p>Run after applet is run. <code>{ns}</code> is the applet's namespace</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">any</span></td><td class="attributes"><repeatable><br></td><td class="description last"><p>Arguments passed to the applet</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line125">line 125</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.runAsApplet">module:Helper.runAsApplet</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~%7Bns%7D:afterInit"><span class="type-signature">(async, inner) </span>{ns}:afterInit<span class="signature">()</span></h3><div class="description"><p>Run after <code>{ns}</code> plugins are initialized. You can use this hook to do some post-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line88">line 88</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~%7Bns%7D:afterStart"><span class="type-signature">(async, inner) </span>{ns}:afterStart<span class="signature">()</span></h3><div class="description"><p>Run after <code>{ns}</code> plugins are started. You can use this hook to do some post-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line106">line 106</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~%7Bns%7D:beforeAppletRun"><span class="type-signature">(async, inner) </span>{ns}:beforeAppletRun<span class="signature">(…args)</span></h3><div class="description"><p>Run before applet is run. <code>{ns}</code> is the applet's namespace</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">any</span></td><td class="attributes"><repeatable><br></td><td class="description last"><p>Arguments passed to the applet</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line115">line 115</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.runAsApplet">module:Helper.runAsApplet</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~%7Bns%7D:beforeInit"><span class="type-signature">(async, inner) </span>{ns}:beforeInit<span class="signature">()</span></h3><div class="description"><p>Run before <code>{ns}</code> plugins are initialized. You can use this hook to do some pre-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line79">line 79</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="~%7Bns%7D:beforeStart"><span class="type-signature">(async, inner) </span>{ns}:beforeStart<span class="signature">()</span></h3><div class="description"><p>Run after <code>{ns}</code> plugins are initialized. You can use this hook to do some pre-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line97">line 97</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.run">module:Helper.run</a></li></ul></dd></div></dl><h2 id="type-definitions" class="subsection-title has-anchor">Type Definitions</h2><h3 class="name has-anchor" id="~THook">THook</h3><div class="member-item-container flex"><strong>Type:</strong><ul><li><span class="param-type">Object</span></li></ul></div><b class="subsection-title">Properties</b><div class="allow-overflow"><table class="props"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th>Default</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook name</p></td></tr><tr><td class="name"><code>ns</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook namespace</p></td></tr><tr><td class="name"><code>handler</code></td><td class="type"><span class="param-type">function</span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook handler function</p></td></tr><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">number</span></td><td class="attributes"><optional><br></td><td class="default">999</td><td class="description last"><p>Hook level (lower number means higher priority)</p></td></tr><tr><td class="name"><code>src</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook source (origin plugin namespace). Bajo will set this automatically, any value you set will be overriden.</p></td></tr><tr><td class="name"><code>noWait</code></td><td class="type"><span class="param-type">boolean</span></td><td class="attributes"><optional><br></td><td class="default">false</td><td class="description last"><p>If true, Bajo will not wait for this hook to complete before proceeding to the next hook. Default is false.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_hook.js.html">lib/hook.js</a>, <a href="lib_hook.js.html#line5">line 5</a></li></ul></dd></div></dl></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|
|
3
|
+
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="light"><div class="sidebar-container"><div class="sidebar" id="sidebar"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-01_WELCOME.html">Welcome</a></div><div class="sidebar-section-children"><a href="tutorial-02_GETTING_STARTED.html">Getting Started</a></div><div class="sidebar-section-children"><a href="tutorial-03_USER_GUIDE.html">User Guide</a></div><div class="sidebar-section-children"><a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a></div><div class="sidebar-section-children"><a href="tutorial-05_ECOSYSTEM.html">Ecosystem</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Main.html">Main</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Applet.html">Applet</a></div><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#TConfig">TConfig</a></div><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div><div class="sidebar-section-children"><a href="global.html#package%25C2%25B7json">package·json</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header></header><article><div class="container-overview"><div class="description"><h1 id="hook">Hook</h1><p>Bajo has a hook system that allows you to run custom code before or after certain events in the framework. You can use hooks to modify the behavior of the framework or to add new functionality.</p><p>Your hook should be put in:</p><ul><li>your plugin's hook folder (also valid for app's <code>main</code> plugin), which is located in <code>{pluginRoot}/extend/bajo/hook</code>. In this case:<ul><li>the file should be named as <code>{hookName}.js</code> for hook that listens for one name or <code>{hookName1}${hookName2}${hookName3}.js</code> for hook that listens for many names. It should be exported as default export</li><li>you can use the exact hook name or follow our convention to use kebab case for the file name, e.g. <code>bajo.override:after-read-config.js</code> for <code>bajo.override:afterReadConfig</code> hook</li><li>content should be a single <a href="module-Hook.html#.THook">module:Hook.THook</a> object. If <code>name</code> property is there, it will be used as the hook name, otherwise it will be reconstructed from the file name. Hence the file name is important</li><li>or simply a function that will be used as the hook handler. In this case, all missing properties will be set to their default values</li></ul></li><li>or as array of hook object in <code>{pluginRoot}/extend/bajo/hook.js</code> file that follows the <a href="module-Hook.html#.THook">module:Hook.THook</a> structure</li></ul><blockquote><p><strong>Note</strong>: Hook handlers can have <code>.</code> dot symbol in their name, but in documentation, the dot symbol will be replaced with <code>·</code> symbol because of JSDoc limitation. For example, a hook handler named <code>bajo.override:afterReadConfig</code> will be documented as <code>bajo·override:afterReadConfig</code>.</p></blockquote><blockquote><p><strong>Warning</strong>: Even though hooks is a powerfull and convenient feature, it should be used with caution. Overusing hooks can lead to code that is difficult to understand and maintain. Use hooks only when necessary and avoid using them for simple tasks that can be accomplished with regular code.</p></blockquote></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line37">line 37</a></li></ul></dd></div></dl></div><h2 id="methods" class="subsection-title has-anchor">Methods</h2><h3 class="name has-anchor" id=".bajo:afterAllInit"><span class="type-signature">(async, static) </span>bajo:afterAllInit<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs after all plugins are initialized. You can use this hook to do some post-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line128">line 128</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:afterAllStart"><span class="type-signature">(async, static) </span>bajo:afterAllStart<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs after all plugins are started. You can use this hook to do some post-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line148">line 148</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:afterBoot"><span class="type-signature">(async, static) </span>bajo:afterBoot<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs after boot process. You can use this hook to do some post-boot process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line97">line 97</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:afterCollectHooks"><span class="type-signature">(async, static) </span>bajo:afterCollectHooks<span class="signature">(hooks)</span></h3><div class="description"><p>Hook handler that runs after hooks are collected. You can use this hook to modify the collected hooks before they are recognized as application hooks.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>hooks</code></td><td class="type"><span class="param-type">Array.<module:Hook~THook></span></td><td class="description last"><p>Array of hook objects</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line106">line 106</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.collectHooks">module:Helper.collectHooks</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:afterReadConfig"><span class="type-signature">(async, static) </span>bajo:afterReadConfig<span class="signature">(file, result, options)</span></h3><div class="description"><p>Hook handler that runs after all read processes of a configuration file are completed.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>file</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file path</p></td></tr><tr><td class="name"><code>result</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>Resulting config object after parsing</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line289">line 289</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:beforeAllInit"><span class="type-signature">(async, static) </span>bajo:beforeAllInit<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs before all plugins are initialized. You can use this hook to do some pre-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line118">line 118</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:beforeAllStart"><span class="type-signature">(async, static) </span>bajo:beforeAllStart<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs before all plugins are started. You can use this hook to do some pre-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line138">line 138</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:beforeBoot"><span class="type-signature">(async, static) </span>bajo:beforeBoot<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs before boot process. You can use this hook to do some pre-boot process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line88">line 88</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo:beforeReadConfig"><span class="type-signature">(async, static) </span>bajo:beforeReadConfig<span class="signature">(file, options)</span></h3><div class="description"><p>Hook handler that runs before a configuration file is read.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>file</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file path</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line278">line 278</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo%C2%B7default:afterReadConfig"><span class="type-signature">(async, static) </span>bajo·default:afterReadConfig<span class="signature">(file, orgObj, options)</span></h3><div class="description"><p>Hook handler that runs after a non override/extended configuration file is read.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>file</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file path</p></td></tr><tr><td class="name"><code>orgObj</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Original config object before parsing</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line220">line 220</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo%C2%B7override:afterReadConfig"><span class="type-signature">(async, static) </span>bajo·override:afterReadConfig<span class="signature">(fileExt, result, options)</span></h3><div class="description"><p>Hook handler that runs after a configuration file override is read.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>fileExt</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file extension</p></td></tr><tr><td class="name"><code>result</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>Resulting config object after parsing</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line243">line 243</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".bajo%C2%B7override:beforeReadConfig"><span class="type-signature">(async, static) </span>bajo·override:beforeReadConfig<span class="signature">(fileExt, options)</span></h3><div class="description"><p>Hook handler that runs before a configuration file override is read.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>fileExt</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Config file extension</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>readConfig options</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line232">line 232</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:afterAppletRun"><span class="type-signature">(async, static) </span>{ns}:afterAppletRun<span class="signature">(…args)</span></h3><div class="description"><p>Hook handler that runs after applet is run. <code>{ns}</code> is the applet's namespace</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">any</span></td><td class="attributes"><repeatable><br></td><td class="description last"><p>Arguments passed to the applet</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line209">line 209</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.runAsApplet">module:Helper.runAsApplet</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:afterBuildCollection"><span class="type-signature">(async, static) </span>{ns}:afterBuildCollection<span class="signature">(container, items)</span></h3><div class="description"><p>Hook handler that runs after a collection is built. <code>{ns}</code> is the collection's namespace. This hook is useful to modify the collection items after they are built.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>container</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Collection container name</p></td></tr><tr><td class="name"><code>items</code></td><td class="type"><span class="param-type">array.<object></span></td><td class="description last"><p>Collection items</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line314">line 314</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Bajo.html#buildCollections">Bajo#buildCollections</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:afterInit"><span class="type-signature">(async, static) </span>{ns}:afterInit<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs after <code>{ns}</code> plugins are initialized. You can use this hook to do some post-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line168">line 168</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:afterStart"><span class="type-signature">(async, static) </span>{ns}:afterStart<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs after <code>{ns}</code> plugins are started. You can use this hook to do some post-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line188">line 188</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:beforeAppletRun"><span class="type-signature">(async, static) </span>{ns}:beforeAppletRun<span class="signature">(…args)</span></h3><div class="description"><p>Hook handler that runs before applet is run. <code>{ns}</code> is the applet's namespace</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">any</span></td><td class="attributes"><repeatable><br></td><td class="description last"><p>Arguments passed to the applet</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line198">line 198</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="module-Helper.html#.runAsApplet">module:Helper.runAsApplet</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:beforeBuildCollection"><span class="type-signature">(async, static) </span>{ns}:beforeBuildCollection<span class="signature">(container, items)</span></h3><div class="description"><p>Hook handler that runs before a collection is built. <code>{ns}</code> is the collection's namespace. This hook is useful to modify the collection items before they are built.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>container</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Collection container name</p></td></tr><tr><td class="name"><code>items</code></td><td class="type"><span class="param-type">array.<object></span></td><td class="description last"><p>Collection items</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line301">line 301</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Bajo.html#buildCollections">Bajo#buildCollections</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:beforeInit"><span class="type-signature">(async, static) </span>{ns}:beforeInit<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs before <code>{ns}</code> plugins are initialized. You can use this hook to do some pre-initialization process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line158">line 158</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h3 class="name has-anchor" id=".%7Bns%7D:beforeStart"><span class="type-signature">(async, static) </span>{ns}:beforeStart<span class="signature">()</span></h3><div class="description"><p>Hook handler that runs before <code>{ns}</code> plugins are started. You can use this hook to do some pre-start process.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line178">line 178</a></li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li>module:Helper.run</li></ul></dd></div></dl><h2 id="type-definitions" class="subsection-title has-anchor">Type Definitions</h2><h3 class="name has-anchor" id=".THook">THook</h3><div class="description"><p>Hook structure definition. Your hook listener should be an object that follows this structure.</p></div><div class="member-item-container flex"><strong>Type:</strong><ul><li><span class="param-type">Object</span></li></ul></div><b class="subsection-title">Properties</b><div class="allow-overflow"><table class="props"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th>Default</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"><span class="param-type">string</span> |<wbr> <span class="param-type">Array.<string></span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook name or array of hook names</p></td></tr><tr><td class="name"><code>handler</code></td><td class="type"><span class="param-type"><a href="module-Hook.html#.hookHandler">module:Hook.<wbr>hookHandler</a></span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook handler function</p></td></tr><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">number</span></td><td class="attributes"><optional><br></td><td class="default">999</td><td class="description last"><p>Hook level (lower number means higher priority)</p></td></tr><tr><td class="name"><code>src</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Hook source (origin plugin name). Bajo will set this automatically, any value you set will be overriden.</p></td></tr><tr><td class="name"><code>noWait</code></td><td class="type"><span class="param-type">boolean</span></td><td class="attributes"><optional><br></td><td class="default">false</td><td class="description last"><p>If <code>true</code>, Bajo will not wait for this hook to complete before proceeding to the next hook. Default is <code>false</code>.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line63">line 63</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".hookHandler"><span class="type-signature">(async) </span>hookHandler<span class="signature">(…args)</span><span class="type-signature"> → {Promise.<void>}</span></h3><div class="description"><p>This is the hook handler function that will be called when the hook is triggered. This handler is scoped to the owning plugin, so you can use <code>this</code> to access the plugin instance and its properties.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">any</span></td><td class="attributes"><repeatable><br></td><td class="description last"><p>Arguments passed to the hook handler</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="lib_applet-hook.js.html">lib/applet-hook.js</a>, <a href="lib_applet-hook.js.html#line76">line 76</a></li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The return value of the hook handler</p></div><dl class="param-type"><dt>Type: </dt><dd><span class="param-type">Promise.<void></span></dd></dl></div></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-01_WELCOME.html">Welcome</a></div><div class="sidebar-section-children"><a href="tutorial-02_GETTING_STARTED.html">Getting Started</a></div><div class="sidebar-section-children"><a href="tutorial-03_USER_GUIDE.html">User Guide</a></div><div class="sidebar-section-children"><a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a></div><div class="sidebar-section-children"><a href="tutorial-05_ECOSYSTEM.html">Ecosystem</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Main.html">Main</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Applet.html">Applet</a></div><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#TConfig">TConfig</a></div><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div><div class="sidebar-section-children"><a href="global.html#package%25C2%25B7json">package·json</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Tutorial: Welcome</title><!--[if lt IE 9]>
|
|
2
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
3
|
+
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="light"><div class="sidebar-container"><div class="sidebar" id="sidebar"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-01_WELCOME.html">Welcome</a></div><div class="sidebar-section-children"><a href="tutorial-02_GETTING_STARTED.html">Getting Started</a></div><div class="sidebar-section-children"><a href="tutorial-03_USER_GUIDE.html">User Guide</a></div><div class="sidebar-section-children"><a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a></div><div class="sidebar-section-children"><a href="tutorial-05_ECOSYSTEM.html">Ecosystem</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Main.html">Main</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Applet.html">Applet</a></div><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#TConfig">TConfig</a></div><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div><div class="sidebar-section-children"><a href="global.html#package%25C2%25B7json">package·json</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header><h2>Welcome</h2></header><article><h1 id="welcome-to-bajo">Welcome to Bajo</h1><p>Welcome to Bajo, <strong>the ultimate framework for whipping up a massive app in no time!</strong></p><p>Bajo is a framework that allows you to build apps with ease, whether it's a command line app or web app of any size. It is designed to be simple, yet powerful, and can be used for a wide range of applications.</p><p>Bajo grew out of the need for a framework that:</p><ul><li>is easy to use and understand even for beginners.</li><li>is modular and extensible. It's like playing with Lego blocks, you can build anything you want by combining different plugins with each other.</li><li>is plug & play, yet easy to customize through configurations only. Less code is always better.</li><li>is fast and efficient, yet easy to scale.</li><li>and last but not least: so much magic! Many people will be critical about it, but hey, who doesn't like magic?</li></ul><p>In Bajo philosophy, everything is a plugin. A plugin should be handling a single responsibility, and can be extended by other plugins. This allows for a very flexible and modular architecture, where you can easily add or remove features as needed.</p><p>A typical Bajo app should be able to run within a few minutes: create a new project directory, create <code>package.json</code> file, create a <a href="global.html#boot">boot file</a>, install as many plugins as you want, done! Yes, it's that simple.</p><p>Now dive in to the tutorials to learn more about Bajo and how to use it to build your next app.</p></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-01_WELCOME.html">Welcome</a></div><div class="sidebar-section-children"><a href="tutorial-02_GETTING_STARTED.html">Getting Started</a></div><div class="sidebar-section-children"><a href="tutorial-03_USER_GUIDE.html">User Guide</a></div><div class="sidebar-section-children"><a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a></div><div class="sidebar-section-children"><a href="tutorial-05_ECOSYSTEM.html">Ecosystem</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Main.html">Main</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Applet.html">Applet</a></div><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#TConfig">TConfig</a></div><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div><div class="sidebar-section-children"><a href="global.html#package%25C2%25B7json">package·json</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Tutorial: Getting Started</title><!--[if lt IE 9]>
|
|
2
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
3
|
+
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="light"><div class="sidebar-container"><div class="sidebar" id="sidebar"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-01_WELCOME.html">Welcome</a></div><div class="sidebar-section-children"><a href="tutorial-02_GETTING_STARTED.html">Getting Started</a></div><div class="sidebar-section-children"><a href="tutorial-03_USER_GUIDE.html">User Guide</a></div><div class="sidebar-section-children"><a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a></div><div class="sidebar-section-children"><a href="tutorial-05_ECOSYSTEM.html">Ecosystem</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Main.html">Main</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Applet.html">Applet</a></div><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#TConfig">TConfig</a></div><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div><div class="sidebar-section-children"><a href="global.html#package%25C2%25B7json">package·json</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header><h2>Getting Started</h2></header><article><h1 id="getting-started">Getting Started</h1><p>Welcome! In this guide, we will take our first steps with Bajo together.</p><p>If this is your first time working with this framework, that is completely fine. We will move step by step: installation, project structure, basic configuration, and your first small app. Along the way, you will also meet two important ideas in Bajo: plugins and hook/lifecycle.</p><p>By the end of this tutorial, you should feel comfortable enough to continue to Bajo's sub-frameworks, such as Dobo and Waibu.</p><h2 id="installation">Installation</h2><p>First, create a new empty directory named <code>my-project</code>. We will use this as the app directory throughout the tutorial. Then, move into that directory with <code>cd</code> and run:</p><pre class="prettyprint source lang-bash"><code>$ npm init
|
|
4
|
+
</code></pre><p>You will be asked for information such as project name, description, and author. Continue until the <em>package.json</em> file is created.</p><p>Next, open that file in your editor and add the following lines:</p><pre class="prettyprint source lang-javascript"><code>...
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bajo": {
|
|
7
|
+
"type": "app"
|
|
8
|
+
},
|
|
9
|
+
...
|
|
10
|
+
</code></pre><p>After that, install Bajo:</p><pre class="prettyprint source lang-bash"><code>$ npm install bajo
|
|
11
|
+
</code></pre><p>Now create a bootstrap file named <code>index.js</code> and add:</p><pre class="prettyprint source lang-javascript"><code>// index.js file
|
|
12
|
+
import { boot } from 'bajo'
|
|
13
|
+
await boot()
|
|
14
|
+
</code></pre><p>A Bajo app <strong>always</strong> needs a data directory for configuration files and related resources. This directory can be inside or outside your app directory.</p><p>If the directory does not exist yet, Bajo will ask you whether to create one automatically or to abort. If you decide to create it, Bajo will make a directory named <code>data</code>, next to your <code>index.js</code> file. By default, this becomes your data directory.</p><p>Now run your app:</p><pre class="prettyprint source lang-bash"><code>$ node index.js
|
|
15
|
+
</code></pre><p>Great work. Your first Bajo app is now running.</p><h2 id="playing-around">Playing Around</h2><p>At this point, your project structure should look like this:</p><pre class="prettyprint source"><code>.
|
|
16
|
+
└── my-project
|
|
17
|
+
├── data
|
|
18
|
+
│ └── config
|
|
19
|
+
├── main
|
|
20
|
+
│ └── index.js
|
|
21
|
+
├── node_modules
|
|
22
|
+
│ └── ...
|
|
23
|
+
├── index.js
|
|
24
|
+
├── package.json
|
|
25
|
+
└── package-lock.json
|
|
26
|
+
</code></pre><p>Bajo automatically creates a <code>main</code> plugin for you. This is the main plugin of your app, and it is where you will put your code.</p><p>By default, the app runs in the <code>dev</code> environment. In this mode, the log level is set to <code>debug</code>. You can override it using program arguments to something like <code>trace</code>, which is the most verbose level, and some other options:</p><pre class="prettyprint source lang-bash"><code>$ node index.js --log-level=trace --log-timeTaken --log-pretty
|
|
27
|
+
</code></pre><p>You should now see more colorful logs, including timing information for each step. This is very useful for debugging and for finding slow parts of the startup process.</p><p>Typing arguments every time can feel repetitive, so let's move those settings into a config file. Create <code>data/config/bajo.yml</code> and add:</p><pre class="prettyprint source lang-yaml"><code>env: dev
|
|
28
|
+
log:
|
|
29
|
+
pretty: true
|
|
30
|
+
level: trace
|
|
31
|
+
timeTaken: true
|
|
32
|
+
</code></pre><blockquote><p>If you like JSON, you can also use <code>bajo.json</code> instead of <code>bajo.yml</code>. Bajo supports both formats.</p></blockquote><p>Now try running the app again without extra arguments:</p><pre class="prettyprint source lang-bash"><code>$ node index.js
|
|
33
|
+
</code></pre><p>Much easier.</p><p>You can combine config values, program arguments, environment variables, and even use a dotenv file (<code>.env</code>) whenever needed. For a deeper explanation, please see the <em>User Guide</em>.</p><h2 id="your-first-project">Your First Project</h2><p>Now let's build a simple <strong>Hello World</strong> example, Bajo style.</p><p>Our goals are:</p><ol><li>Read values from configuration.</li><li>Copy those values into plugin properties during initialization.</li><li>Display the values while the app is running.</li><li>Print a message when the app exits.</li></ol><p>Let's begin.</p><h3 id="config-object">Config Object</h3><p>Open <code>data/config/main.yml</code> (or create it if it does not exist). This is the configuration file for the main plugin.</p><p>Add:</p><pre class="prettyprint source lang-yaml"><code>firstName: Tanjiro
|
|
34
|
+
lastName: Kamado
|
|
35
|
+
age: 15
|
|
36
|
+
</code></pre><p>Each Bajo plugin can read its configuration from <code>{dataDir}/config/{ns}.yml</code>, where <code>{dataDir}</code> is your data directory and <code>{ns}</code> is the plugin namespace or name. You can read more in the <a href="tutorial-03_USER_GUIDE.html">User Guide</a>.</p><p>In Bajo, most features are built through plugins. For small projects, using the built-in <code>main</code> plugin is usually enough. As your project grows, you can split responsibilities into smaller independent plugins.</p><p>If you want to build your own plugin, please continue with the <a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a>.</p><h3 id="plugin-factory">Plugin Factory</h3><p>Now open <code>main/index.js</code> and update it like this:</p><p>This file is your main plugin factory. Bajo creates it automatically when needed.</p><pre class="prettyprint source lang-javascript"><code>async function factory (pkgName) {
|
|
37
|
+
const me = this
|
|
38
|
+
|
|
39
|
+
return class Main extends this.app.baseClass.Base {
|
|
40
|
+
constructor () {
|
|
41
|
+
super(pkgName, me.app)
|
|
42
|
+
this.config = {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// start adding these lines
|
|
46
|
+
init = async () => {
|
|
47
|
+
this.firstName = this.config.firstName
|
|
48
|
+
this.lastName = this.config.lastName
|
|
49
|
+
this.age = this.config.age
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
start = async () => {
|
|
53
|
+
this.log.info('First name: %s, Last name: %s, age: %d', this.firstName, this.lastName, this.age)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
exit = async () => {
|
|
57
|
+
this.log.warn('Program aborted')
|
|
58
|
+
}
|
|
59
|
+
// end of added lines
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default factory
|
|
64
|
+
</code></pre><p>Here is what happens during the lifecycle:</p><ul><li>During boot, the main plugin reads <code>main.yml</code> and merges it with matching program arguments and environment variables to build the plugin's configuration object.</li><li>Next, initialization runs through main plugin <code>init</code> method. In this example, we copy values from <code>this.config</code> into plugin properties.</li><li>Then the plugin starts through the <code>start</code> method, where we print the values to the logger.</li><li>Finally, when the app exits, the <code>exit</code> method runs.</li></ul><p>This is the standard lifecycle pattern for all Bajo plugins, including the special main plugin.</p><p>But if you run it now, you will likely get an error. The reason is that keys from the config file (<code>firstName</code>, <code>lastName</code>, and <code>age</code>) are not yet declared in <code>this.config</code>, so they are ignored during initialization.</p><p>Let's fix that by defining default values first:</p><pre class="prettyprint source lang-javascript"><code>...
|
|
65
|
+
constructor () {
|
|
66
|
+
super(pkgName, me.app)
|
|
67
|
+
this.config = {
|
|
68
|
+
firstName: 'John',
|
|
69
|
+
lastName: 'Doe',
|
|
70
|
+
age: 50
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
...
|
|
74
|
+
</code></pre><p>The <code>this.config</code> object in the constructor acts as the default configuration. During startup, Bajo merges it with values from configuration files or program options. If any key is missing in the file, the default value is used.</p><p>Run the app again, and this time let's keep output concise with:</p><pre class="prettyprint source lang-bash"><code>$ node index.js --log-level=info
|
|
75
|
+
2025-09-12T00:09:38.946Z +97ms INFO: main First name: Tanjiro, Last name: Kamado, age: 15
|
|
76
|
+
2025-09-12T00:09:38.949Z +3ms WARN: main Program aborted
|
|
77
|
+
</code></pre><p>Nice!</p><h2 id="the-hook-system">The Hook System</h2><h3 id="tapping-a-hook">Tapping a Hook</h3><p>Bajo has a very powerful, yet so simple hook system so you can add custom behavior at specific moments. We will start with a simple case: running code right after boot completes.</p><p>Create <code>main/extend/bajo/hook/bajo@after-boot.js</code>. If the naming looks unusual, that is expected; please read <a href="module-Hook.html">module:Hook</a> file naming instructions for more.</p><pre class="prettyprint source lang-javascript"><code>async function afterBootComplete () {
|
|
78
|
+
this.log.info('Hook after boot complete')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default afterBootComplete
|
|
82
|
+
</code></pre><p>That is your first hook listener. It taps into the <code>bajo:afterBoot</code> hook, which runs after the boot process completes. You can check the full list of hooks <a href="module-Hook.html">here</a>.</p><h3 id="your-own-hook">Your Own Hook</h3><p>Now let's write your own custom hook. For this small example it may feel too over the top, but it shows how flexible Bajo can be.</p><p>This time, we will update all properties through a hook.</p><p>Open <code>index.js</code> and update it like this:</p><pre class="prettyprint source lang-javascript"><code>...
|
|
83
|
+
init = async () => {
|
|
84
|
+
const { runHook } = this.app.bajo // add this line
|
|
85
|
+
this.firstName = this.config.firstName
|
|
86
|
+
this.lastName = this.config.lastName
|
|
87
|
+
this.age = this.config.age
|
|
88
|
+
await runHook('main:myHook') // and this line
|
|
89
|
+
}
|
|
90
|
+
...
|
|
91
|
+
</code></pre><p>This will add a hook named <code>main:myHook</code> during app boot.</p><p>Now create a new file as the hook listener for the hook you just created: <code>main/extend/bajo/hook/main@my-hook.js</code></p><pre class="prettyprint source lang-javascript"><code>async function myHook () {
|
|
92
|
+
// 'this' is bound to the owner plugin, that is the main plugin in this case
|
|
93
|
+
this.lastName = 'THE Daemon Slayer'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default myHook
|
|
97
|
+
</code></pre><p>In Bajo, class methods, hooks, and handlers run within its plugin scope, so setting <code>this.lastName</code> directly inside the hook is enough.</p><p>Run the app again. You should see output similar to this:</p><pre class="prettyprint source lang-bash"><code>2025-09-12T12:09:09.004Z +115ms INFO: main First name: Tanjiro, Last name: THE Daemon Slayer, age: 15
|
|
98
|
+
2025-09-12T12:09:09.008Z +4ms INFO: main Hook after boot complete
|
|
99
|
+
2025-09-12T12:09:09.009Z +1ms WARN: main Program aborted
|
|
100
|
+
</code></pre><p>As you can see, <code>this.lastName</code> was updated by the hook successfully. You can also see the <code>afterBoot</code> hook running after the main plugin starts.</p><h2 id="using-external-plugins">Using External Plugins</h2><p>Bajo is designed as an ecosystem of small plugins. You can think of them like building blocks: combine the ones you need to create your own app behavior.</p><p>In this section, we will use plugins to extend the app.</p><h3 id="toml-file-format">TOML File Format</h3><p>Let's switch the configuration format to TOML.</p><ol><li>TOML support is provided by the <code>bajo-config</code> plugin, so install it first:<pre class="prettyprint source lang-bash"><code>$ npm install bajo-config
|
|
101
|
+
</code></pre></li><li>Open <code>data/config/.plugins</code> and add <code>bajo-config</code> in it. If the file does not exist yet, create it first. Plugin order is usually resolved automatically by Bajo.</li><li>Remove <code>data/config/main.yml</code> and create <code>data/config/main.toml</code>.</li><li>Add the same object as before, now in TOML:<pre class="prettyprint source"><code>firstName = "Tanjiro"
|
|
102
|
+
lastName = "Kamado"
|
|
103
|
+
age = 15
|
|
104
|
+
</code></pre></li><li>Run the app and check the result. It should match the previous behavior, except for different timestamps.</li></ol><h3 id="applet-mode">Applet Mode</h3><p><strong>Applets</strong> are small tools embedded within plugins that run when Bajo is in <strong>applet mode</strong>. They have their own lifecycle, separate from the main program, but they can still reuse shared resources and config.</p><p>To run Bajo in applet mode, use <code>--applet</code> or <code>-a</code>:</p><pre class="prettyprint source lang-bash"><code>$ node index.js -a
|
|
105
|
+
</code></pre><p>Applet mode needs <code>bajo-cli</code>, so install it first:</p><pre class="prettyprint source lang-bash"><code>$ npm install bajo-cli
|
|
106
|
+
</code></pre><p>Then add <code>bajo-cli</code> to the <code>data/config/.plugins</code> file. Again, plugin order is not a concern in this case.</p><p>If you run it now, your terminal may show something like this:</p><pre class="prettyprint source lang-bash"><code>ℹ App runs in applet mode
|
|
107
|
+
? Please select: (Use arrow keys)
|
|
108
|
+
❯ bajoConfig
|
|
109
|
+
bajoCli
|
|
110
|
+
</code></pre><p>Notice that the app reports it is running in applet mode. The interface becomes an interactive CLI view, and regular logs are hidden.</p><p>By default, logs are disabled in applet mode to keep the console clean. During debugging, you can enable logs again by adding <code>--log-applet</code> to your command.</p><p>Applets are optional utilities provided by plugin authors, so it could be the case that some plugins have many applets in it while others have none.</p><h3 id="system-info">System Info</h3><p>Now let's install one more plugin: <code>bajo-sysinfo</code>. It is a thin wrapper over <a href="https://github.com/sebhildebrandt/systeminformation">systeminformation</a> with a few helpful additions:</p><ul><li>It can be called directly as an applet.</li><li>It is also exposed as Waibu REST API endpoints. We will cover it much later.</li></ul><p>If you run the app like this (yes, <code>--applet</code> can take a value; details are <a href="module-Applet.html">here</a>, you may see output like the following after loading:</p><pre class="prettyprint source lang-bash"><code>$ node index.js -a bajoSysinfo:battery
|
|
111
|
+
ℹ App runs in applet mode
|
|
112
|
+
ℹ Done!
|
|
113
|
+
┌──────────────────┬─────────────────────┐
|
|
114
|
+
│ hasBattery │ true │
|
|
115
|
+
├──────────────────┼─────────────────────┤
|
|
116
|
+
│ cycleCount │ 0 │
|
|
117
|
+
├──────────────────┼─────────────────────┤
|
|
118
|
+
│ isCharging │ true │
|
|
119
|
+
├──────────────────┼─────────────────────┤
|
|
120
|
+
│ designedCapacity │ 61998 │
|
|
121
|
+
├──────────────────┼─────────────────────┤
|
|
122
|
+
│ maxCapacity │ 51686 │
|
|
123
|
+
├──────────────────┼─────────────────────┤
|
|
124
|
+
...
|
|
125
|
+
</code></pre><h2 id="more">More</h2><p>Bajo offers much more beyond this tiny introduction. When you are ready, continue with these sub-framework guides below. In the mean time, please feel free to also explore the <a href="tutorial-03_USER_GUIDE.html">User Guide</a> and <a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a>.</p><ul><li><a href="https://github.com/ardhi/dobo/wiki/GETTING-STARTED.md">Dobo DBMS</a></li><li><a href="https://github.com/ardhi/waibu/wiki/GETTING-STARTED.md">Waibu Web Framework</a></li><li><a href="https://github.com/ardhi/sumba/wiki/GETTING-STARTED.md">Sumba Biz Suites</a></li><li><a href="https://github.com/ardhi/masohi/wiki/GETTING-STARTED.md">Masohi Messaging</a></li></ul></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><a href="/" class="sidebar-title sidebar-title-anchor">Bajo API</a><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://www.npmjs.com/package/bajo" target="">NPM</a></div><div class="navbar-item"><a id="" href="https://github.com/ardhi/bajo" target="">Github</a></div><div class="navbar-item"><a id="" href="https://bajo.app" target="">Bajo</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-01_WELCOME.html">Welcome</a></div><div class="sidebar-section-children"><a href="tutorial-02_GETTING_STARTED.html">Getting Started</a></div><div class="sidebar-section-children"><a href="tutorial-03_USER_GUIDE.html">User Guide</a></div><div class="sidebar-section-children"><a href="tutorial-04_DEV_GUIDE.html">Developer Guide</a></div><div class="sidebar-section-children"><a href="tutorial-05_ECOSYSTEM.html">Ecosystem</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="App.html">App</a></div><div class="sidebar-section-children"><a href="Bajo.html">Bajo</a></div><div class="sidebar-section-children"><a href="Base.html">Base</a></div><div class="sidebar-section-children"><a href="Cache.html">Cache</a></div><div class="sidebar-section-children"><a href="Err.html">Err</a></div><div class="sidebar-section-children"><a href="Log.html">Log</a></div><div class="sidebar-section-children"><a href="Main.html">Main</a></div><div class="sidebar-section-children"><a href="Plugin.html">Plugin</a></div><div class="sidebar-section-children"><a href="Print.html">Print</a></div><div class="sidebar-section-children"><a href="Tools.html">Tools</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-Applet.html">Applet</a></div><div class="sidebar-section-children"><a href="module-Helper.html">Helper</a></div><div class="sidebar-section-children"><a href="module-Hook.html">Hook</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#TConfig">TConfig</a></div><div class="sidebar-section-children"><a href="global.html#boot">boot</a></div><div class="sidebar-section-children"><a href="global.html#package%25C2%25B7json">package·json</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#dark-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|