Generators

Generators are used to build formatted data for sending to the user in response to requests. They encapsulate creation, formatting, and delivering a file to the user.

All generator objects implement the BinaryData interface so they can be returned as responses to HTTP requests, or added to the file store.

Example

An example response handler which generates a very simple spreadsheet.

P.respond("GET", "/do/example/xls", [
], function(E) {
    var xls = O.generate.table.xls("Test");
    xls.newSheet("Sheet1");
    xls.cell("Test").cell(2);
    E.response.body = xls;
});

Generators

O.generate.table