I know how to write Meteor packages but I can't seem to figure out how to have all exports land in my app's namespace, as described in this presentation.
This particular package is specific to an app I'm building, and it exports only one method that can be regarded as a decorator on the app's singleton. I tried api.export('MyApp.myMethod') but that gives an error native: Bad exported symbol: MyApp.myMethod.
If I just api.export('myMethod'), then in the app code I have to call myMethod(), and that's not namespaced.
Does Meteor have a mechanism similar to Node's var http = require('http');? Or how can packages export symbols into a given namespace?
In your package, you should define all methods and symbols in the namespace you want them to have, and then export that namespace. So, if in your package you've got:
Then you export it with
api.export('MyApp').Unfortunately, there's no method similar to the one in Node you've mentioned, as all packages are loaded globally on startup.