Sorry about a noob question. In this example:
console.log("I am top level code");
Meteor.startup(function () {
console.log(" I am running inside startup");
});
Both seem to run roughly at the same time (with startup running slightly later).
From the docs:
On a server, the function will run as soon as the server process is finished starting. On a client, the function will run as soon as the DOM is ready
…
On a client, startup callbacks from packages will be called first, followed by templates from your .html files, followed by your application code.
Is not it the same as top level code? When is top level called? On client and server.