Loading the Meteor

Let’s find out how code is loaded in MeteorJS.

Default export

Files and variables must be exported before they can be imported and used elsewhere. We can do this by using the ES2015 export statement. The code snippet below exports a function called addNumbers from addition.js. We then import this function for use in our index.js.

This is referred to as a default export because we can name it whatever we want when we import the function. See the example below:

Get hands-on with 1400+ tech skills courses.