{"id":32486333,"url":"https://github.com/fefeding/jm-ssi","last_synced_at":"2026-05-17T19:34:47.642Z","repository":{"id":57281141,"uuid":"210003750","full_name":"fefeding/jm-ssi","owner":"fefeding","description":"node下解析ssi","archived":false,"fork":false,"pushed_at":"2019-09-24T04:37:37.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T05:51:35.638Z","etag":null,"topics":["nodejs","ssi"],"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/fefeding.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":"2019-09-21T14:56:09.000Z","updated_at":"2022-05-31T07:20:59.000Z","dependencies_parsed_at":"2022-09-19T21:03:26.507Z","dependency_job_id":null,"html_url":"https://github.com/fefeding/jm-ssi","commit_stats":null,"previous_names":["fefeding/jm-ssi","jiamao/jm-ssi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fefeding/jm-ssi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefeding%2Fjm-ssi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefeding%2Fjm-ssi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefeding%2Fjm-ssi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefeding%2Fjm-ssi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fefeding","download_url":"https://codeload.github.com/fefeding/jm-ssi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefeding%2Fjm-ssi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33151843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["nodejs","ssi"],"created_at":"2025-10-27T05:50:02.187Z","updated_at":"2026-05-17T19:34:47.637Z","avatar_url":"https://github.com/fefeding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jm-ssi\n\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n\n`nodejs` 解析`ssi`库。\n\n支持以下语法：\n```html\n \u003c!--# include file=\"path\" --\u003e\n\u003c!--# include virtual=\"path\" --\u003e\n\n\u003c!--# set var=\"k\" value=\"v\" --\u003e\n\n\u003c!--# echo var=\"name\" default=\"default\" --\u003e\n\n\u003c!--# if expr=\"$name = /text/\" --\u003e\n\u003c!--# if expr=\"$name != text\" --\u003e\n\u003c!--# else --\u003e\n\u003c!--# endif --\u003e\n```\n\n## Install\n\n```bash\n$ npm i jm-ssi --save\n```\n\n## Usage\n\n```js\nconst ssi = require('jm-ssi');\n\nssi.run(`\u003c!--#if expr=\"\\${HTTP_HOST} = /www.tenganxinxi.com/\"--\u003e\n\u003ctitle\u003e腾讯腾安\u003c/title\u003e\n\u003c!--#elif expr=\"\\${HTTP_HOST} = /www.txfund.com/--\u003e\n\u003ctitle\u003e腾讯腾安2\u003c/title\u003e\n\u003c!--#else--\u003e\n\u003ctitle\u003e腾讯理财通\u003c/title\u003e\n\u003c!--#endif--\u003e`, {\n    // 指定执行变量\n    data: {\n        \"HTTP_HOST\": \"www.txfund.com\"\n    }\n}).then((result) =\u003e {\n    console.log(result);\n});\n\n```\n\n#### 文件模板解析\n`index.shtml`\n```html\n\u003c!--#if expr=\"${HTTP_HOST} = www.tenganxinxi.com\"--\u003e\n\u003ctitle\u003e腾讯腾安\u003c/title\u003e\n\u003c!--#else--\u003e\n\u003ctitle\u003e腾讯理财通\u003c/title\u003e\n\u003c!--#endif--\u003e\n\n\u003cdiv\u003etest $ ````\u003c/div\u003e\n\n\u003c!--#echo var=\"HTTP_USER_AGENT\" --\u003e\n\n\u003c!--# include virtual=\"/if.shtml\" stub=\"one\" --\u003e\n```\n\n```js\nconst path = require('path');\nconst ssi = require('jm-ssi');\n\nconst root = path.join(__dirname, 'templates');\nssi.parse('index.shtml', {\n    // 指定执行变量\n    data: {\n        \"name\": 'fefeding',\n        \"HTTP_HOST\": \"www.txfund.com\",\n        \"HTTP_USER_AGENT\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1 wechatdevtools/1.02.1907300 MicroMessenger/6.7.3 Language/zh_CN webview/1568882530032134 webdebugger port/31804\",\n    },\n    root\n}).then(result =\u003e {\n    console.log(result);\n});\n```\n\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/jm-ssi.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/jm-ssi\n[download-image]: https://img.shields.io/npm/dm/jm-ssi.svg?style=flat-square\n[download-url]: https://npmjs.org/package/jm-ssi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffefeding%2Fjm-ssi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffefeding%2Fjm-ssi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffefeding%2Fjm-ssi/lists"}