Home / Function/ render() — express Function Reference

render() — express Function Reference

Architecture documentation for the render() function in view.js from the express codebase.

Entity Profile

Dependency Diagram

graph TD
  12dcf80d_bea6_f289_ee01_ef4ea5bb6a43["render()"]
  f3f6b3ab_6685_aeb3_01fc_79fc5a3a9b41["view.js"]
  12dcf80d_bea6_f289_ee01_ef4ea5bb6a43 -->|defined in| f3f6b3ab_6685_aeb3_01fc_79fc5a3a9b41
  style 12dcf80d_bea6_f289_ee01_ef4ea5bb6a43 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/view.js lines 133–159

View.prototype.render = function render(options, callback) {
  var sync = true;

  debug('render "%s"', this.path);

  // render, normalizing sync callbacks
  this.engine(this.path, options, function onRender() {
    if (!sync) {
      return callback.apply(this, arguments);
    }

    // copy arguments
    var args = new Array(arguments.length);
    var cntx = this;

    for (var i = 0; i < arguments.length; i++) {
      args[i] = arguments[i];
    }

    // force callback to be async
    return process.nextTick(function renderTick() {
      return callback.apply(cntx, args);
    });
  });

  sync = false;
};

Domain

Subdomains

Defined In

Frequently Asked Questions

What does render() do?
render() is a function in the express codebase, defined in lib/view.js.
Where is render() defined?
render() is defined in lib/view.js at line 133.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free