Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-prefixed-roots-view

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-prefixed-roots-view

Alternative View class, provides another lookup method based on mappings prefix: dir

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

express-prefixed-roots-view

Alternative View class, provides another lookup method based on mappings prefix: dir.

Now, you can use multiple view dirs with express and use prefixes to access templates in it.

Compatible with express 3.x. Tested with express 3.2.x.

You can use npm for install the last stable version:

$ npm install express-prefixed-roots-view

Usage:

app.set('view', require('express-prefixed-roots-view'));
app.set('views', {
  '': __dirname + '/views',
  'module': __dirname + '/module/views',
  'module2': __dirname + '/module2/views'
});

Now, when you call res.render('index'), it only tries to render '/views/index'.

When your call res.render('module/index'), it tries to render '/views/module/index', if such file does not exists, it tries to render '/module/views/index'.

So, you can override templates, provided with modules.

Keywords

FAQs

Package last updated on 13 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc