🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

strapi-hook-ejs

Package Overview
Dependencies
Maintainers
7
Versions
236
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-hook-ejs

EJS hook for the Strapi framework

latest
Source
npmnpm
Version
3.6.11
Version published
Weekly downloads
1K
4950%
Maintainers
7
Weekly downloads
 
Created
Source

strapi-hook-ejs

npm version npm downloads npm dependencies Build status Slack status

This built-in hook allows you to use the EJS template engine with custom options.

Deprecation Warning :warning:

Hello, we've some news to share!

We released Strapi V4 in Q4 2021 and Strapi V3 will reach end-of-support around the end of Q3 2022.

Since this package won't be ported in V4, we took the decision to deprecate it.

If you’ve contributed to the development of this package, thank you again for that! We hope to see you on the V4 soon.

The Strapi team

Configuration

To configure your hook with custom options, you need to edit your ./config/hook.json file in your Strapi app.

{
  ...
  "ejs": {
    "enabled": true,
    "layout": "layout",
    "viewExt": "ejs",
    "partial": true,
    "cache": false,
    "debug": true
  }
}

More information in the Koa ejs module https://github.com/koajs/ejs#settings

Usage

Insert code in your controller to render a view.

module.exports = {
  home: async ctx => {
    return ctx.render('home', {
      title: 'My app title',
    });
  },
};

This will render the views/home.ejs file and you will have access to <%= title %> data in your ejs file.

Resources

  • License

Keywords

ejs

FAQs

Package last updated on 22 Nov 2022

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