Zebra API Doc

zebra.namespace()

namespace

(
  • nsname
)
Function

Create a new or return existent name space by the given name. The names space is structure to host various packages, classes, interfaces and so on. Usually developers should use "zebra" name space to access standard zebra classes, interfaces, methods and packages and also to put own packages, classes etc there. But in some cases it can be convenient to keep own stuff in a dedicated project specific name space.

Parameters:

  • nsname String

    a name space name


Return: Function

an existent or created name space. Name space is function that can be called to:

  • Get the bound to the given name space variables:

Example:

    // get all variables of "zebra" namespace 
    var variables = zebra();
    variables["myVariable"] = "myValue" // set variables in "zebra" name space
  • Get list of packages that are hosted under the given name space:
   // get all packages that "zebra" name space contain
   zebra(function(packageName, package) {
         ...                
   });
  • Create or access a package by the given package name (can be hierarchical):
   var pkg = zebra("test.io") // create or get "test.io" package