modules

modules Though Meteor 1.2 introduced support for many new ECMAScript 2015 features, one of the most notable omissions was ES2015 import and export syntax. Meteor 1.3 fills that gap with a fully standards-compliant module system that works on both the client and the server, solves multiple long-standing problems for Meteor applications (such as controlling file load order), and yet maintains full backwards compatibility with existing Meteor code. This document explains the usage and key feature

computation.stop

Client computation.stop() Source Prevents this computation from rerunning.

Tracker.nonreactive

Client Tracker.nonreactive(func) import { Tracker } from 'meteor/tracker' Source Run a function without tracking dependencies. Arguments func Function A function to call immediately.

meteor add

meteor add package Add packages to your Meteor project. By convention, names of community packages include the name of the maintainer. For example: meteor add iron:router. You can add multiple packages with one command. Optionally, adds version constraints. Running meteor add package@1.1.0 will add the package at version 1.1.0 or higher (but not 2.0.0 or higher). If you want to use version 1.1.0 exactly, use meteor add package@=1.1.0. You can also 'or' constraints together: for example, meteor

AccountsCommon#config

Anywhere accountsClientOrServer.config(options) Source Set global accounts options. Options sendVerificationEmail Boolean New users with an email address will receive an address verification email. forbidClientAccountCreation Boolean Calls to createUser from the client will be rejected. In addition, if you are using accounts-ui, the "Create account" link will not be available. restrictCreationByEmailDomain String or Function If set to a string, only allows new users if the do

HTTP.call

Anywhere HTTP.call(method, url, [options], [asyncCallback]) import { HTTP } from 'meteor/http' Source Perform an outbound HTTP request. Arguments method String The HTTP method to use, such as "GET", "POST", or "HEAD". url String The URL to retrieve. asyncCallback Function Optional callback. If passed, the method runs asynchronously, instead of synchronously, and calls asyncCallback. On the client, this callback is required. Options content String String to use as the HT

Accounts.removeEmail

Server Accounts.removeEmail(userId, email) import { Accounts } from 'meteor/accounts-base' Source Remove an email address for a user. Use this instead of updating the database directly. Arguments userId String The ID of the user to update. email String The email address to remove.

cursor.forEach

Anywhere cursor.forEach(callback, [thisArg]) Source Call callback once for each matching document, sequentially and synchronously. Arguments callback Function Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself. thisArg Any An object which will be the value of this inside callback.

Meteor.publish

Server Meteor.publish(name, func) import { Meteor } from 'meteor/meteor' Source Publish a record set. Arguments name String Name of the record set. If null, the set has no name, and the record set is automatically sent to all connected clients. func Function Function called on the server each time a client subscribes. Inside the function, this is the publish handler object, described below. If the client passed arguments to subscribe, the function is called with the same argument

Blaze.Template

Client new Blaze.Template([viewName], renderFunction) import { Blaze } from 'meteor/blaze' Source Constructor for a Template, which is used to construct Views with particular name and content. Arguments viewName String Optional. A name for Views constructed by this Template. See view.name. renderFunction Function A function that returns renderable content. This function is used as the renderFunction for Views constructed by this Template.