Package.onTest

Unit Tests Set up your tests with the Package.onTest handler, which has an interface that's parallel to that of the onUse handler. The tests will need to depend on the package that you have just created. For example, if your package is the email package, you have to call api.use('email') in order to test the package. If you used meteor create to set up your package, Meteor will create the required scaffolding in package.js, and you'll only need to add unit test code in the _test.js file that

Package.describe

Package Description Provide basic package information with Package.describe(options). To publish a package, you must define summary and version. package.js Package.describe(options) Provide basic package information. Options summary String A concise 1-2 sentence description of the package, required for publication. version String The (extended) semver version for your package. Additionally, Meteor allows a wrap number: a positive integer that follows the version number. If you a

onRendered

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

onDestroyed

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

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.

oauth-encryption

oauth-encryption Encrypts sensitive login secrets stored in the database such as a login service's application secret key and users' access tokens.

Npm.require

Server Npm.require(name) Require a package that was specified using Npm.depends(). Arguments name String The name of the package to require.

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({

Mongo.ObjectID

Anywhere new Mongo.ObjectID([hexString]) import { Mongo } from 'meteor/mongo' Source Create a Mongo-style ObjectID. If you don't specify a hexString, the ObjectID will generated randomly (not using MongoDB's ID construction rules). Arguments hexString String Optional. The 24-character hexadecimal contents of the ObjectID to create

Mongo.Cursor

Cursors To create a cursor, use find. To access the documents in a cursor, use forEach, map, or fetch. 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. This interface is compatible with Array