{"id":13798969,"url":"https://github.com/d-band/koa-view","last_synced_at":"2025-09-04T19:43:58.947Z","repository":{"id":74172163,"uuid":"50637931","full_name":"d-band/koa-view","owner":"d-band","description":"Template rendering middleware for koa (using nunjucks).","archived":false,"fork":false,"pushed_at":"2025-08-02T10:11:10.000Z","size":71,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-02T12:27:52.182Z","etag":null,"topics":["koa","koa-view","koa2","nunjucks"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-band.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-01-29T04:42:31.000Z","updated_at":"2024-06-26T07:30:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"fea8a07b-b8af-4704-89a3-d55d9ad3e5c3","html_url":"https://github.com/d-band/koa-view","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d-band/koa-view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Fkoa-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Fkoa-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Fkoa-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Fkoa-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-band","download_url":"https://codeload.github.com/d-band/koa-view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Fkoa-view/sbom","scorecard":{"id":315211,"data":{"date":"2025-08-11","repo":{"name":"github.com/d-band/koa-view","commit":"7778602e540f3a38035fe8d80bd80923d57950c1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"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":"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":1,"reason":"Found 2/16 approved changesets -- score normalized to 1","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 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-18T00:03:01.818Z","repository_id":74172163,"created_at":"2025-08-18T00:03:01.818Z","updated_at":"2025-08-18T00:03:01.818Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273665600,"owners_count":25146272,"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-09-04T02:00:08.968Z","response_time":61,"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":["koa","koa-view","koa2","nunjucks"],"created_at":"2024-08-04T00:00:57.288Z","updated_at":"2025-09-04T19:43:53.923Z","avatar_url":"https://github.com/d-band.png","language":"JavaScript","funding_links":[],"categories":["仓库"],"sub_categories":["中间件"],"readme":"# koa-view\n\n[![NPM version](https://img.shields.io/npm/v/koa-view.svg)](https://www.npmjs.com/package/koa-view)\n[![Dependency Status](https://david-dm.org/d-band/koa-view.svg)](https://david-dm.org/d-band/koa-view)\n[![Build Status](https://travis-ci.org/d-band/koa-view.svg?branch=master)](https://travis-ci.org/d-band/koa-view)\n[![Coverage Status](https://coveralls.io/repos/github/d-band/koa-view/badge.svg?branch=master)](https://coveralls.io/github/d-band/koa-view?branch=master)\n[![Greenkeeper badge](https://badges.greenkeeper.io/d-band/koa-view.svg)](https://greenkeeper.io/)\n\n\u003e Template rendering middleware for koa (using [nunjucks](https://github.com/mozilla/nunjucks)).\n\n## Installation\n\n```\n$ npm install koa-view\n```\n\n## [Example](./examples/simple)\n\n```js\nconst view = require('koa-view');\n\n// Must be used before any router is used\napp.use(view(__dirname + '/views'));\n\napp.use(async function (ctx) {\n  ctx.state = {\n    session: ctx.session,\n    title: 'app'\n  };\n\n  await ctx.render('user', {\n    user: 'Coder'\n  });\n});\n```\n\nMore examples: [tests](./test/index.js)\n\n## API\n\n#### `view(root, opts)`\n\n* `root`: (default `views`) Views location. All view you `render()` are relative to this path.\n* `opts` [nunjucks configure opts](http://mozilla.github.io/nunjucks/api.html#configure)\n* `opts.ext`: (default `html`) Extension for your view\n\n```js\n// instead of this\nawait ctx.render('user.html')\n// you can\nawait ctx.render('user')\n```\n\n## Koa 1 Support\n\nTo use `koa-view` with koa@1, please use [koa-view 1.x](https://github.com/d-band/koa-view/tree/v1.x).\n\n```bash\nnpm install koa-view@1 --save\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-band%2Fkoa-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-band%2Fkoa-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-band%2Fkoa-view/lists"}