Browse files

update readme with modules sharing system docs

  • Loading branch information...
Grigore147 committed Oct 18, 2012
1 parent 9a3e038 commit 172dd1120b466514c1243f99432c5d4e5769655b
Showing with 35 additions and 0 deletions.
  1. +35 −0
@@ -174,6 +174,41 @@ For example auth module can look like this:
and then in our controller we can access user object as `Request.user`.
+### Sharing modules
+[Katana]( comes with an basic modules sharing system which allow to download public modules and install them for application.
+Katana binary has few new commands for interacting with modules:
+* `katana modules` - list all available modules.
+* `katana modules-search <str>` - search modules that contain `str` in name or description.
+* `katana modules-update` - update modules list and their info.
+* `katana modules-install <name> [url]` - install or reinstall app module.
+ * `name` or `name@version` - module name
+ * `url` or `username:repository` or `username:repository@version` - optional url or github username:repository combination.
+ If only `name` is provided then download url will be builded from module data contained in modules registry file. The name could also be followed by an version tag.<br>
+ If second argument is an url then module will be downloaded from that url.<br>
+ If second argument is an combination of `username:repository@version` then the url will be: ``.<br>
+ If no `version` provided then requested one will be last available version for module in registry. If no valid version will be detected then `master` brunch will be requested.<br>
+ For custom download url modules still must be gzipped tarballs.<br>
+ Examples of install:
+ * `katana modules-install auth`
+ * `katana modules-install auth@0.1.0`
+ * `katana modules-install Shogun147:Katana-auth`
+ * `katana modules-install Shogun147:Katana-auth@0.1.0`
+ * `katana modules-install`
+ * `katana modules-install`
+* `katana modules-uninstall <name>` - uninstall and remove module
+* `katana modules-enable <name>` - enable module
+* `katana modules-disable <name>` - disable module
+For each of this actions [`install`, `uninstall`, `enable`, `disable`] modules could have their hooks which would be called. The hooks are stored in hooks directory of module.<br>
+The hooks are useful when there is a need to do something unique on this actions. For ex the `install` hook (modules/:name/hooks/install.js) could create new tables in the database or copy modules assets to public directory…
+The module registry is downloaded from ``. To add new modules to the list just fork this file and send an pull request. This will make your module listed on `katana modules` command and on search.
## Controllers
Controllers are almost most important part of any application, they handle incoming requests and send responses.

0 comments on commit 172dd11

Please sign in to comment.