Creating a package
In this section, we will learn how to create a custom package and use it in our application.
Note
The packages creation example that we are going to see is with respect to MeteorJS version 1.1.x. Note that there could be changes in the API or the structure with the next release.
We have to know two things about creating packages. If we are going to create a package for public use or common purpose (such as using it across applications), then it is always good to keep the package out of the application. However, if we are going to create a package to wrap the modules of the application, which means it is going to be application-specific, then we will keep it inside the packages directory inside the application.
Why would someone write their application modules as packages? There are a lot of advantages. When we write a package, we gain control over the order in which the files are run. Also, we expose what needs to be exposed. We can write tests for that particular module inside...