Commands

Space Kitty uses capsulecat:commands to create dispatchable, reusable commands and actions.

Command

kitty make:command Namespace Command

Output

This will create a file /lib/commands/Namespace/Command.js

/**
 * Namespace Command
 */
Namespace = typeof Namespace === 'undefined' ? {} : Namespace;

Namespace.Command = function () {
 var handle = function () {
 //
 };

 return {
 handle: handle
 }
};

You can make a client only or server only by adding an option to the end of your command:

kitty make:command MyNamespace MyCommand --client

 

Previous: Making Meteor Methods

Next URLs and Routes