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

lark-views

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lark-views

Template rendering middleware for koa, supporting many template engines

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

lark-views

This repository began as a GitHub fork of queckezz/koa-views.

NPM version build status NPM downloads Node.js dependencies

Template rendering middleware for koa, supporting many template engines.

Installation

$ npm install lark-views

Example

Use lark-views as a Class.

const Views = require('lark-views');

const views = new Views({
  path: 'views',
  map: {
    tpl: 'ejs',
  }
});

views.render('a.tpl', { foo: "bar" })
     .then(data => console.log(data))
     .catch(e => console.error(e.stack));

API

views([opts])
  • opts: see below
  • opts.map: map from extname to template engine name.
  • opts.path: directory path relative from main module file if it is not an absolute path.
  • opts.engine: template engine, must have a method render(template, data) which returns final result.

License

MIT

Keywords

FAQs

Package last updated on 13 Apr 2017

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