Socket
Socket
Sign inDemoInstall

egg-view-lambda

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

egg-view-lambda

Render response with a lambda function


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

egg-view-lambda

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-view-lambda --save

Usage

// {app_root}/config/plugin.js
exports.lambda = {
  enable: true,
  package: 'egg-view-lambda'
}

// {app_root}/config/config.default.js
exports.view = {
  mapping: {
    '.js': 'lambda'
  }
}

Create a view file

// app/view/hello.js
module.exports = locals => ({
  hello: locals.name
})

Render it

// app/controller/render.js
exports.render = async ctx => {
  await ctx.render('hello.js', {
    name: 'world'
  })
}

Configuration

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

FAQs

Package last updated on 11 May 2018

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