Home / File/ view.js — express Source File

view.js — express Source File

Architecture documentation for view.js, a javascript file in the express codebase.

Entity Profile

Relationship Graph

Source Code

/*!
 * express
 * Copyright(c) 2009-2013 TJ Holowaychuk
 * Copyright(c) 2013 Roman Shtylman
 * Copyright(c) 2014-2015 Douglas Christopher Wilson
 * MIT Licensed
 */

'use strict';

/**
 * Module dependencies.
 * @private
 */

var debug = require('debug')('express:view');
var path = require('node:path');
var fs = require('node:fs');

/**
 * Module variables.
 * @private
 */

var dirname = path.dirname;
var basename = path.basename;
var extname = path.extname;
var join = path.join;
var resolve = path.resolve;

/**
 * Module exports.
 * @public
 */

module.exports = View;

/**
 * Initialize a new `View` with the given `name`.
 *
 * Options:
 *
 *   - `defaultEngine` the default template engine name
 *   - `engines` template engine require() cache
 *   - `root` root path for view lookup
 *
 * @param {string} name
 * @param {object} options
 * @public
 */

function View(name, options) {
  var opts = options || {};

  this.defaultEngine = opts.defaultEngine;
  this.ext = extname(name);
  this.name = name;
  this.root = opts.root;

  if (!this.ext && !this.defaultEngine) {
// ... (146 more lines)

Domain

Subdomains

Frequently Asked Questions

What does view.js do?
view.js is a source file in the express codebase, written in javascript. It belongs to the ExpressCore domain, MiddlewarePipeline subdomain.
What functions are defined in view.js?
view.js defines 5 function(s): View, lookup, render, resolve, tryStat.
Where is view.js in the architecture?
view.js is located at lib/view.js (domain: ExpressCore, subdomain: MiddlewarePipeline, directory: lib).

Analyze Your Own Codebase

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

Try Supermodel Free