Socket
Socket
Sign inDemoInstall

express-prefixed-roots-view

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

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


Version published
Maintainers
1
Install size
4.75 kB
Created

Readme

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

Last updated on 13 May 2013

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc