Introduction

What is Meteor? Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node.js and general JavaScript community. Meteor allows you to develop in one language, JavaScript, in all environments: application server, web browser, and mobile device. Meteor uses data on the wire, meaning the server sends data, not

Meteor.wrapAsync

Anywhere Meteor.wrapAsync(func, [context]) import { Meteor } from 'meteor/meteor' Source Wrap a function that takes a callback function as its final parameter. The signature of the callback of the wrapped function should be function(error, result){}. On the server, the wrapped function can be used either synchronously (without passing a callback) or asynchronously (when a callback is passed). On the client, a callback is always required; errors will be logged if there is no callback. If

Meteor.logoutOtherClients

Client Meteor.logoutOtherClients([callback]) import { Meteor } from 'meteor/meteor' Source Log out other clients logged in as the current user, but does not log out the client that calls this function. Arguments callback Function Optional callback. Called with no arguments on success, or with a single Error argument on failure.

Template.registerHelper

Client Template.registerHelper(name, function) import { Template } from 'meteor/templating' Source Defines a helper function which can be used from all templates. Arguments name String The name of the helper function you are defining. function Function The helper function itself.

onCreated

Client Template.myTemplate.onCreated import { Template } from 'meteor/templating' Source Register a function to be called when an instance of this template is created. Arguments callback Function A function to be added as a callback.

meteor publish

meteor publish Publishes your package. To publish, you must cd into the package directory, log in with your Meteor Developer Account and run meteor publish. By convention, published package names must begin with the maintainer's Meteor Developer Account username and a colon, like so: iron:router. To publish a package for the first time, use meteor publish --create. Sometimes packages may contain binary code specific to an architecture (for example, they may use an npm package). In that case, ru

HTTP.del

Anywhere HTTP.del(url, [callOptions], [asyncCallback]) import { HTTP } from 'meteor/http' Source Send an HTTP DELETE request. Equivalent to calling HTTP.call with "DELETE" as the first argument. (Named del to avoid conflict with the Javascript keyword delete) Arguments url String The URL to which the request should be sent. callOptions Object Options passed on to HTTP.call. asyncCallback Function Callback that is called when the request is completed. Required on the client.

Accounts.setUsername

Server Accounts.setUsername(userId, newUsername) import { Accounts } from 'meteor/accounts-base' Source Change a user's username. Use this instead of updating the database directly. The operation will fail if there is an existing user with a username only differing in case. Arguments userId String The ID of the user to update. newUsername String A new username for the user.

Blaze.Each

Client Blaze.Each(argFunc, contentFunc, [elseFunc]) import { Blaze } from 'meteor/blaze' Source Constructs a View that renders contentFunc for each item in a sequence. Arguments argFunc Function A function to reactively re-run. The function can return one of two options: An object with two fields: '_variable' and '_sequence'. Each iterates over '_sequence', it may be a Cursor, an array, null, or undefined. Inside the Each body you will be able to get the current item from the sequen

template.$

Client template.$(selector) Source Find all elements matching selector in this template instance, and return them as a JQuery object. Arguments selector String The CSS selector to match, scoped to the template contents.