computation.onInvalidate

Client computation.onInvalidate(callback) Source Registers callback to run when this computation is next invalidated, or runs it immediately if the computation is already invalidated. The callback is run exactly once and not upon future invalidations unless onInvalidate is called again after the computation becomes valid again. Arguments callback Function Function to be called on invalidation. Receives one argument, the computation that was invalidated.

Blaze.toHTML

Client Blaze.toHTML(templateOrView) import { Blaze } from 'meteor/blaze' Source Renders a template or View to a string of HTML. Arguments templateOrView Blaze.Template or Blaze.View The template (e.g. Template.myTemplate) or View object from which to generate HTML.

Npm.depends

package.js Npm.depends(dependencies) Specify which NPM packages your Meteor package depends on. Arguments dependencies Object An object where the keys are package names and the values are one of: Version numbers in string form Http(s) URLs to a git commit by SHA. Git URLs in the format described here Https URL example: Npm.depends({ moment: "2.8.3", async: "https://github.com/caolan/async/archive/71fa2638973dafd8761fa5457c472a312cc820fe.tar.gz" }); Git URL example: Npm.depends({

Package.registerBuildPlugin

package.js Package.registerBuildPlugin([options]) Define a build plugin. A build plugin extends the build process for apps and packages that use this package. For example, the coffeescript package uses a build plugin to compile CoffeeScript source files into JavaScript. Options name String A cosmetic name, must be unique in the package. use String or Array of Strings Meteor packages that this plugin uses, independent of the packages specified in api.onUse. sources Array of Strin

Session.equals

Client Session.equals(key, value) import { Session } from 'meteor/session' Source Test if a session variable is equal to a value. If inside a reactive computation, invalidate the computation the next time the variable changes to or from the value. Arguments key String The name of the session variable to test value String, Number, Boolean, null, or undefined The value to test against

Meteor.userId

Anywhere but publish functions Meteor.userId() import { Meteor } from 'meteor/meteor' Source Get the current user id, or null if no user is logged in. A reactive data source.

Change log

2016/04/16: Switch order of Code Style and Application structure sections. PR #383 2016/04/16: Added Writing Packages - Creating an npm package and Using Packages - Overriding packages - npm. PR #381 2016/04/07: Add more examples and details on application structure using imports. PR #356 2016/04/04: Add more content on writing and publishing Atmosphere packages. PR #339 2016/04/03: Add back in build tool default loading order rules. PR #340 2016/04/01: Added CoffeeScript exports syntax. P

Accounts.sendEnrollmentEmail

Server Accounts.sendEnrollmentEmail(userId, [email]) import { Accounts } from 'meteor/accounts-base' Source Send an email with a link the user can use to set their initial password. Arguments userId String The id of the user to send email to. email String Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.

Accounts.findUserByUsername

Server Accounts.findUserByUsername(username) import { Accounts } from 'meteor/accounts-base' Source Finds the user with the specified username. First tries to match username case sensitively; if that fails, it tries case insensitively; but if more than one user matches the case insensitive search, it returns null. Arguments username String The username to look for

Assets.getBinary

Server Assets.getBinary(assetPath, [asyncCallback]) Retrieve the contents of the static server asset as an EJSON Binary. Arguments assetPath String The path of the asset, relative to the application's private subdirectory. asyncCallback Function Optional callback, which is called asynchronously with the error or result after the function is complete. If not provided, the function runs synchronously.