{"id":18484142,"url":"https://github.com/jdf2e/jdf-template-transform","last_synced_at":"2025-04-08T18:33:10.063Z","repository":{"id":57279958,"uuid":"112722146","full_name":"jdf2e/jdf-template-transform","owner":"jdf2e","description":"velocity-\u003esmarty/trimpath模板转换包","archived":false,"fork":false,"pushed_at":"2017-12-06T10:22:34.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T18:02:08.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jiadi0801.github.io/vmconvert.html","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/jdf2e.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":"2017-12-01T09:39:03.000Z","updated_at":"2017-12-20T06:41:05.000Z","dependencies_parsed_at":"2022-09-17T17:20:32.213Z","dependency_job_id":null,"html_url":"https://github.com/jdf2e/jdf-template-transform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-template-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-template-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-template-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-template-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdf2e","download_url":"https://codeload.github.com/jdf2e/jdf-template-transform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209879,"owners_count":20901875,"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","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-06T12:38:43.552Z","updated_at":"2025-04-08T18:33:05.580Z","avatar_url":"https://github.com/jdf2e.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jdf-template-transform\nvelocity template transform to smarty or trimpath template\n\nvelocity模板 转 smarty模板或者trimpath模板\n\n## 安装\n```\nnpm install jdf-template-transform --save\n```\n\n## api\n```\nconst c2tpl = require('jdf-template-transform');\nlet content = '\u003cdiv\u003e$foo\u003c/div\u003e'\n\nc2tpl.convert(content); // \u003cdiv\u003e{$foo}\u003c/div\u003e\nc2tpl.convert(content, 'trimpath'); // \u003cdiv\u003e${foo}\u003c/div\u003e\n\n```\n\n## 转换的特性有：\n* 变量：支持纯变量，点连接，方括号连接，变量嵌套\n* 赋值：支持数字，字符串，数组，变量、比较表达式等赋值方式\n* 运算：+ - * / ()，其他暂未实现\n* 比较：\u003e \u003c \u003e= \u003c= == == != !，不支持三目运算符 \n* 判断：与或非\n* if/elseif/else\n* foreach, 不支持foreachelse\n* $velocityCount or $foreach.count\n\n## 不支持特性\n* filter\n* method调用\n* null、undefined定义\n* 对象定义（支持对象调用）\n* 宏定义\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdf2e%2Fjdf-template-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdf2e%2Fjdf-template-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdf2e%2Fjdf-template-transform/lists"}