Zetta Reference Docs

Reference docs for zetta
  • openbook Reference
  • user Adam Magaluk
  • calendar Jun 13, 2014

Class: Zetta

This is the base module for Zetta. It is accessed by using require('zetta') in node. This class exposes functionality
for standing up your Zetta server, and linking to the cloud.

Method: name(name)
  • name String

Give your zetta instance a human readable name. This will be exposed in the API using the name property.

var zetta = require('zetta');
Method: silent()

Suppress logging messages.

var zetta = require('zetta');
Method: logger(logFunction)
  • logFunction Function

Implement a custom logger for Zetta.

var zetta = require('zetta');
  .logger(function(log) {
    log.on('message', function(level, event, msg, data) {
      //Intercept logging messages.  
Method: use(constructor, [args], [options])
  • constructor Function
  • [args] list of arguments
  • [options] Object

Load a device driver into Zetta. These can be custom drivers that you’ve written, or drivers retrieved from npm.

var zetta = require('zetta');
var arduino = require('arduino');
Method: load(app)
  • app Function

Load a zetta app from another module.

var zetta = require('zetta');
var myApp = require('./myapp.js');
Method: link(host)
  • host String or Array of Strings

Link to another Zetta instance. Typically this is used to link your local instance of Zetta to the cloud.

var zetta = require('zetta');
Method: listen(port, [hostname], [callback])
  • port Number
  • hostname String
  • callback Function

Select which port your instance of Zetta will listen on locally.

var zetta = require('zetta');
  .listen(3000, function(err) {
    console.log('Server listening on port 3000');