Gathering detailed insights and metrics for shusc-egg-view-ejs
Gathering detailed insights and metrics for shusc-egg-view-ejs
npm install shusc-egg-view-ejs
Typescript
Module System
Min. Node Version
65.1
Supply Chain
99.2
Quality
75
Maintenance
25
Vulnerability
100
License
JavaScript (100%)
Total Downloads
565
Last Day
2
Last Week
4
Last Month
10
Last Year
55
64 Stars
19 Commits
10 Forks
12 Watching
3 Branches
26 Contributors
Latest Version
2.0.1
Package Id
shusc-egg-view-ejs@2.0.1
Unpacked Size
7.78 kB
Size
3.55 kB
File Count
11
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
33.3%
4
Compared to previous week
Last month
400%
10
Compared to previous month
Last year
-3.5%
55
Compared to previous year
egg view plugin for ejs.
1$ npm i egg-view-ejs --save
1// {app_root}/config/plugin.js 2exports.ejs = { 3 enable: true, 4 package: 'egg-view-ejs', 5}; 6 7// {app_root}/config/config.default.js 8exports.view = { 9 mapping: { 10 '.ejs': 'ejs', 11 }, 12}; 13 14// ejs config 15exports.ejs = {};
Create a ejs file
1// app/view/hello.ejs 2hello <%= data %>
Render it
1// app/controller/render.js
2exports.ejs = async ctx => {
3 await ctx.renderEjs('hello.ejs', {
4 data: 'world',
5 });
6};
The file will be compiled and cached, you can change config.ejs.cache = false
to disable cache, it's disable in local env by default.
You can include both relative and absolute file.
Relative file is resolve from current file path.
1// app/view/a.ejs include app/view/b.ejs 2<% include b.ejs %>
Absolute file is resolve from app/view
.
1// app/view/home.ejs include app/view/partial/menu.ejs 2<% include /partial/menu.ejs %>
You can render a view with layout also:
1// app/view/layout.ejs 2 3<%- body%> 4 5// app/controller/render.js 6exports.ejs = async ctx => { 7 const locals = { 8 data: 'world', 9 }; 10 11 const viewOptions = { 12 layout: 'layout.ejs' 13 }; 14 15 await ctx.render('hello.ejs', locals, viewOptions); 16};
see config/config.default.js for more detail.
Please open an issue here.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 10/18 approved changesets -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More