api.export

package.js

api.export(exportedObjects, [architecture], [exportOptions], exportOptions.testOnly)

Export package-level variables in your package. The specified variables (declared without var in the source code) will be available to packages that use your package. If your package sets the debugOnly, prodOnly or testOnly options to true when it calls Package.describe(), then packages that use your package will need to use Package["package-name"].ExportedVariableName to access the value of an exported variable.

Arguments

exportedObjects String or Array of Strings

Name of the object to export, or an array of object names.

architecture String or Array of Strings

If you only want to export the object on the server (or the client), you can pass in the second argument (e.g., 'server', 'client', 'web.browser', 'web.cordova') to specify what architecture the export is used with. You can specify multiple architectures by passing in an array, for example ['web.cordova', 'os.linux'].

exportOptions Object
exportOptions.testOnly Boolean

If true, this symbol will only be exported when running tests for this package.

doc_Meteor
2016-05-29 17:17:50
Comments
Leave a Comment

Please login to continue.