title: Global variables in Meteor
body: <p>I have</p>
  
  <pre><code>var Schemas = {};
  
  Meteor.isClient &amp;&amp; Template.registerHelper("Schemas", Schemas);
  
  Schemas.Person = new SimpleSchema({
    fullName: {
      type: String,
      index: 1,
      optional: true,
    },
    email: {
      type: String,
      optional: true
    },
    address: {
      type: String,
      optional: true
    },
    isActive: {
      type: Boolean,
    },
    age: {
      type: Number,
      optional: true
    }
  });
  </code></pre>
  
  <p>in one file and</p>
  
  <pre><code>var Collections = {};
  
  Meteor.isClient &amp;&amp; Template.registerHelper("Collections", Collections);
  
  Persons = Collections.Persons = new Mongo.Collection("Persons");
  Persons.attachSchema(Schemas.Person);
  </code></pre>
  
  <p>in another file.</p>
  
  <p>I get the error <code>ReferenceError: Schemas is not defined</code>. It's rather obvious that I have to define <code>Schemas</code> in my <code>collections.js</code> file instead of having them separate. But how does Meteor work with code in separate files? I can access some objects and variables while others are unaccessible.</p>