Skip to content

Instantly share code, notes, and snippets.

@peterchoo
Created April 9, 2015 11:46
Show Gist options
  • Save peterchoo/1c977753b2d44f5e44c1 to your computer and use it in GitHub Desktop.
Save peterchoo/1c977753b2d44f5e44c1 to your computer and use it in GitHub Desktop.
Sample helper package
MyObject = {};
/**
* Common functions
*/
MyObject.common = function() {};
/**
* Client only
*/
if (Meteor.isClient) {
MyObject.client = function() {};
}
/**
* Server only
*/
if (Meteor.isServer) {
MyObject.server = function() {};
}
Package.onUse(function(api) {
api.versionsFrom('1.1.0.2');
/**
* Common must be loaded first.
*/
api.addFiles('helper.js');
api.export('MyObject');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment