{"id":20818332,"url":"https://github.com/lpgray/node-vc","last_synced_at":"2026-04-15T12:31:44.198Z","repository":{"id":71026430,"uuid":"21225135","full_name":"lpgray/node-vc","owner":"lpgray","description":"A light weight node view-controller framework","archived":false,"fork":false,"pushed_at":"2014-11-24T11:16:49.000Z","size":256,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T01:28:24.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/lpgray.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}},"created_at":"2014-06-26T02:17:08.000Z","updated_at":"2014-11-25T08:06:02.000Z","dependencies_parsed_at":"2023-02-25T22:45:37.570Z","dependency_job_id":null,"html_url":"https://github.com/lpgray/node-vc","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.2142857142857143,"last_synced_commit":"d4fa0bcd999f3fcfdcc845dd0e6d7d4d44fdb107"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lpgray/node-vc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgray%2Fnode-vc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgray%2Fnode-vc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgray%2Fnode-vc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgray%2Fnode-vc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpgray","download_url":"https://codeload.github.com/lpgray/node-vc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgray%2Fnode-vc/sbom","scorecard":{"id":600518,"data":{"date":"2025-08-11","repo":{"name":"github.com/lpgray/node-vc","commit":"d4fa0bcd999f3fcfdcc845dd0e6d7d4d44fdb107"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-21T00:17:47.880Z","repository_id":71026430,"created_at":"2025-08-21T00:17:47.880Z","updated_at":"2025-08-21T00:17:47.880Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T11:29:19.690Z","status":"ssl_error","status_checked_at":"2026-04-15T11:29:19.171Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-17T21:46:23.597Z","updated_at":"2026-04-15T12:31:44.176Z","avatar_url":"https://github.com/lpgray.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-vc\n\n一个不到200行代码的\"node 视图-控制器\"小框架。\n\n## 特性\n\n### 简单的路由映射\n\n`'post:/submit' : 'handlerName'`，`handlerName`会处理`/submit`请求的`post`类型。\n\n### json及html\n\n可以在controller中选择json输出还是基于ejs的html输出。\n\n### 少逻辑\n\n你只需要按例子定义 `nodevc.json` 文件，然后直接在你的入口代码中编写 `require('node-vc').start()` 即可，剩下的都交给你的 `controller` 来处理。\n\n## 例子\n\n- 请查看example文件夹\n- `npm install`\n- `node app.js`\n- 访问[http://127.0.0.1:8080](http://127.0.0.1:8080)\n- 再访问[http://127.0.0.1:8080/json](http://127.0.0.1:8080/json)\n- 是不是很爽\n\n## 如何开始\n\n### 安装node-vc\n\n\tnpm install node-vc\n\n### 配置 nodevc.json\n\n添加一个nodevc.json文件，如果你在控制台中运行`node app.js`，你必须把 `nodevc.json` 文件跟`app.js`文件放在同一个文件夹下。\n\n在我下面定义的例子中，views文件夹和controllers文件夹都是在项目根目录。\n\n```javascript\n{\n\t\"port\" : \"8080\",\n\t\"views_folder\" : \"views\",\n\t\"controllers_folder\" : \"controllers\",\n\t\"mapping\" : {\n\t\t\"/\" : \"common.index\",\n\t\t\"/json\" : \"common.index_json\"\n\t}\n}\n```\n- port: web服务器的port\n- views_folder: ejs模板所在的文件夹\n- controllers_folder: 控制器所在的文件夹\n- mapping: 路由配置，例如当请求首页的时候，会映射到 common.js 的 index 函数。\n\n\n### 创建一个视图\n\n在上面定义的views文件夹下创建一个index.ejs文件。\n\n### 创建控制器\n\n在上面定义的controllers文件夹下建立一个common.js文件，然后在里面写两个函数。\n\n```javascript\n// http:locahost:8080/ 的get类型的请求会定位到这里\n// 这个函数会用返回的数据{data:\"Hello node-vc\"}渲染index.ejs文件\nexports.index = function(req, resp, callback){\n\tcallback(0, 'index', {data : 'Hello node-vc!'});\n}\n\n// http:locahost:8080/index_json 的get类型的请求会定位到这里\n// 这个函数没有指定视图\n// 在callback的第二个参数传递0\n// 会把{data : 'Hello World'}直接返回json字符串到浏览器端。\nexports.index_json = function(req, resp, params, callback){\n\tcallback(0, 0, {data : 'Hello node-vc!'});\n}\n\n// 在params中获取你传的参数\nexports.controller = (req, resp, params, callback){\n\n}\n```\n\n### Cookies\n\n\n\n### 拦截器\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpgray%2Fnode-vc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpgray%2Fnode-vc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpgray%2Fnode-vc/lists"}