{"id":13487515,"url":"https://github.com/eggjs/egg-view-ejs","last_synced_at":"2025-08-21T02:31:33.916Z","repository":{"id":41153170,"uuid":"82151620","full_name":"eggjs/egg-view-ejs","owner":"eggjs","description":"egg view plugin for ejs.","archived":false,"fork":false,"pushed_at":"2022-06-29T03:53:07.000Z","size":32,"stargazers_count":64,"open_issues_count":0,"forks_count":10,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-08-10T14:21:20.024Z","etag":null,"topics":["egg","egg-plugin","egg-view","ejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-16T07:18:46.000Z","updated_at":"2024-07-03T11:33:43.000Z","dependencies_parsed_at":"2022-09-05T14:00:51.322Z","dependency_job_id":null,"html_url":"https://github.com/eggjs/egg-view-ejs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/eggjs/egg-view-ejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-view-ejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-view-ejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-view-ejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-view-ejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs","download_url":"https://codeload.github.com/eggjs/egg-view-ejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-view-ejs/sbom","scorecard":{"id":368788,"data":{"date":"2025-08-11","repo":{"name":"github.com/eggjs/egg-view-ejs","commit":"d080208cbf3e71c9a85f586d491474eb76d8b654"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":5,"reason":"Found 10/18 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/eggjs/egg-view-ejs/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/eggjs/egg-view-ejs/nodejs.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/eggjs/egg-view-ejs/nodejs.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:39","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T12:29:55.305Z","repository_id":41153170,"created_at":"2025-08-18T12:29:55.305Z","updated_at":"2025-08-18T12:29:55.305Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271416859,"owners_count":24755976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egg","egg-plugin","egg-view","ejs"],"created_at":"2024-07-31T18:01:00.212Z","updated_at":"2025-08-21T02:31:33.648Z","avatar_url":"https://github.com/eggjs.png","language":"JavaScript","readme":"# egg-view-ejs\n\n[![NPM version](https://img.shields.io/npm/v/egg-view-ejs.svg?style=flat-square)](https://npmjs.org/package/egg-view-ejs)\n[![NPM quality](http://npm.packagequality.com/shield/egg-view-ejs.svg?style=flat-square)](http://packagequality.com/#?package=egg-view-ejs)\n[![NPM download](https://img.shields.io/npm/dm/egg-view-ejs.svg?style=flat-square)](https://npmjs.org/package/egg-view-ejs)\n\n[![Continuous Integration](https://github.com/eggjs/egg-view-ejs/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/egg-view-ejs/actions/workflows/nodejs.yml)\n[![Test coverage](https://img.shields.io/codecov/c/github/eggjs/egg-view-ejs.svg?style=flat-square)](https://codecov.io/gh/eggjs/egg-view-ejs)\n\n\negg view plugin for [ejs].\n\n## Install\n\n```bash\n$ npm i egg-view-ejs --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.ejs = {\n  enable: true,\n  package: 'egg-view-ejs',\n};\n\n// {app_root}/config/config.default.js\nexports.view = {\n  mapping: {\n    '.ejs': 'ejs',\n  },\n};\n```\n\nCreate a ejs file\n\n```js\n// app/view/hello.ejs\nhello \u003c%= data %\u003e\n```\n\nRender it\n\n```js\n// app/controller/render.js\nexports.ejs = async ctx =\u003e {\n  await ctx.render('hello.ejs', {\n    data: 'world',\n  });\n};\n```\n\nThe file will be compiled and cached, you can change `config.ejs.cache = false` to disable cache, it's disable in local env by default.\n\n### Include\n\nYou can include both relative and absolute file.\n\nRelative file is resolve from current file path.\n\n```html\n// app/view/a.ejs include app/view/b.ejs\n\u003c% include('b.ejs') %\u003e\n```\n\nAbsolute file is resolve from `app/view`.\n\n```html\n// app/view/home.ejs include app/view/partial/menu.ejs\n\u003c% include('/partial/menu.ejs') %\u003e\n```\n\n### Layout\n\nYou can render a view with layout also:\n\n```js\n// app/view/layout.ejs\n\n\u003c% body %\u003e\n\n// app/controller/render.js\nexports.ejs = async ctx =\u003e {\n  const locals = {\n    data: 'world',\n  };\n\n  const viewOptions = {\n    layout: 'layout.ejs'\n  };\n\n  await ctx.render('hello.ejs', locals, viewOptions);\n};\n```\n\n## Configuration\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n\n[ejs]: https://github.com/mde/ejs\n","funding_links":[],"categories":["仓库"],"sub_categories":["插件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-view-ejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs%2Fegg-view-ejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-view-ejs/lists"}