{"id":30877422,"url":"https://github.com/lvchengbin/tengine","last_synced_at":"2026-05-20T05:06:33.900Z","repository":{"id":65515382,"uuid":"156261587","full_name":"LvChengbin/tengine","owner":"LvChengbin","description":"Unifying APIs of various of template engines.","archived":false,"fork":false,"pushed_at":"2018-11-29T06:18:48.000Z","size":322,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T17:12:05.755Z","etag":null,"topics":["consolidate","engine","render","renderstring","template","tpl"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"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/LvChengbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-11-05T18:09:58.000Z","updated_at":"2018-11-29T06:18:49.000Z","dependencies_parsed_at":"2023-01-26T21:25:13.624Z","dependency_job_id":null,"html_url":"https://github.com/LvChengbin/tengine","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/LvChengbin/tengine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LvChengbin%2Ftengine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LvChengbin%2Ftengine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LvChengbin%2Ftengine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LvChengbin%2Ftengine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LvChengbin","download_url":"https://codeload.github.com/LvChengbin/tengine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LvChengbin%2Ftengine/sbom","scorecard":{"id":87018,"data":{"date":"2025-08-11","repo":{"name":"github.com/LvChengbin/tengine","commit":"1e44eaf2630ea72dad1c4b012edf94767f023a80"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"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":"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":"Code-Review","score":0,"reason":"Found 0/28 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":"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":"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":"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":"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":"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":"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":"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 2 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"}},{"name":"Vulnerabilities","score":0,"reason":"79 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-wxhq-pm8v-cw75","Warn: Project is vulnerable to: GHSA-4vmm-mhcq-4x9j","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-297x-8xj4-vcxv","Warn: Project is vulnerable to: GHSA-4859-gpc7-4j66","Warn: Project is vulnerable to: GHSA-c6rp-wrp9-qr4q","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-x77j-w7wf-fjmw","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-p493-635q-r6gr","Warn: Project is vulnerable to: GHSA-3965-hpx2-q597","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-34r7-q49f-h37c","Warn: Project is vulnerable to: GHSA-c9f4-xj24-8jqx","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T07:08:23.833Z","repository_id":65515382,"created_at":"2025-08-15T07:08:23.833Z","updated_at":"2025-08-15T07:08:23.833Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274130242,"owners_count":25227272,"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-08T02:00:09.813Z","response_time":121,"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":["consolidate","engine","render","renderstring","template","tpl"],"created_at":"2025-09-08T04:03:02.623Z","updated_at":"2026-05-20T05:06:33.861Z","avatar_url":"https://github.com/LvChengbin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tengine\nUnifying APIs of various of template engines.\n\n [![Build Status](https://travis-ci.com/LvChengbin/tengine.svg?branch=master)](https://travis-ci.com/LvChengbin/tengine)\n [![Coverage Status](https://img.shields.io/codecov/c/github/LvChengbin/tengine.svg?style=flat)](https://codecov.io/gh/LvChengbin/tengine)\n [![Node Version](https://img.shields.io/node/v/tengine.svg)](https://nodejs.org)\n [![License](https://img.shields.io/npm/l/tengine.svg)](https://en.wikipedia.org/wiki/MIT_License)\n [![NPM Version](https://img.shields.io/npm/v/tengine.svg)](https://www.npmjs.com/package/tengine)\n [![NPM Download](https://img.shields.io/npm/dw/tengine.svg)](https://www.npmjs.com/package/tengine) [![Greenkeeper badge](https://badges.greenkeeper.io/LvChengbin/tengine.svg)](https://greenkeeper.io/)\n\n## Installation\n\n```sh\n$ npm install tengine --save\n```\n\n## Usage\n\n```js\nconst path = require( 'path' );\nconst tengine = require( 'tengine' );\n\nconst engine = tengine( 'nunjucks' );\n\nengine.configure( {\n    config : {\n        autoescape : false\n    },\n    filters : {\n        repeat : str =\u003e str + str\n    }\n} );\n\nengine.global = { engine : 'tengine' };\neigine.base = path.join( __dirname, 'templates' );\n\nengine.render( 'index.html', {\n    title : 'tengine'\n} ).then( res =\u003e {\n    console.log( res );\n} );\n```\n\n## Supported template engines\n\n - [x] [doT](https://github.com/olado/doT) [(website)](http://olado.github.io/doT/) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/doT.js)\n - [x] [dust](https://github.com/linkedin/dustjs) [(website)](http://linkedin.github.io/dustjs/) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/dust.js)\n - [ ] [eco](https://github.com/sstephenson/eco)\n - [ ] [ect](https://github.com/baryshev/ect) [(website)](http://ectjs.com/)\n - [x] [ejs](https://github.com/mde/ejs) [(website)](http://ejs.co/) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/ejs.js)\n - [ ] [haml](https://github.com/visionmedia/haml.js)\n - [ ] [haml-coffee](https://github.com/9elements/haml-coffee)\n - [ ] [handlebars](https://github.com/wycats/handlebars.js/) [(website)](http://handlebarsjs.com/)\n - [ ] [hogan](https://github.com/twitter/hogan.js) [(website)](http://twitter.github.com/hogan.js/)\n - [ ] [htmling](https://github.com/codemix/htmling)\n - [x] [jade](https://github.com/visionmedia/jade) [(website)](http://jade-lang.com/) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/jade.js)\n - [ ] [jazz](https://github.com/shinetech/jazz)\n - [ ] [jqtpl](https://github.com/kof/jqtpl)\n - [ ] [liquid](https://github.com/leizongmin/tinyliquid) [(website)](http://liquidmarkup.org/)\n - [x] [lodash](https://github.com/bestiejs/lodash) [(website)](http://lodash.com/) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/lodash.js)\n - [ ] [marko](https://github.com/marko-js/marko) [(website)](http://markojs.com)\n - [x] [mustache](https://github.com/janl/mustache.js) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/mustache.js)\n - [x] [nunjucks](https://github.com/mozilla/nunjucks) [(website)](https://mozilla.github.io/nunjucks) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/nunjucks.js)\n - [ ] [plates](https://github.com/flatiron/plates)\n - [ ] [pug](https://github.com/pugjs/pug) [(website)](http://jade-lang.com/)\n - [ ] [ractive](https://github.com/Rich-Harris/Ractive)\n - [ ] [react](https://github.com/facebook/react)\n - [ ] [slm](https://github.com/slm-lang/slm)\n - [ ] [swig-templates](https://github.com/node-swig/swig-templates)\n - [ ] [swig](https://github.com/paularmstrong/swig)\n - [ ] [teacup](https://github.com/goodeggs/teacup)\n - [ ] [templayed](http://archan937.github.com/templayed.js/)\n - [ ] [toffee](https://github.com/malgorithms/toffee)\n - [ ] [twig](https://github.com/justjohn/twig.js)\n - [x] [underscore](https://github.com/documentcloud/underscore) [(website)](http://underscorejs.org/#template) [(example)](https://github.com/LvChengbin/tengine/blob/master/example/underscore.js)\n - [ ] [vash](https://github.com/kirbysayshi/vash)\n - [ ] [walrus](https://github.com/jeremyruppel/walrus) [(website)](http://documentup.com/jeremyruppel/walrus/)\n - [ ] [whiskers](https://github.com/gsf/whiskers.js)\n\n## APIs\n\n### tengine( string name[, object engine ] )\n\nTo initialize a template Engine\n\n - name: the name of the template engine, see [Supported template engines](#)\n - engine: to specify another template engine for replacing the default engine.\n\n```js\nconst engine = tengine( 'doT' );\n```\n\n```js\nconst nunjucks = require( 'nunjucks' );\nconst engine = tengine( 'nunjucks', nunjucks );\n```\n\n### tengine.support( string name )\n\nto check if the template engine is supported in tengine.\n\n- name: the name of the template engine\n\n### tengine.engines\n\nAn array of supported template engine's name.\n\n### engine.global \n\nGlobal variables for templates.\n\n```js\nconst engine = require( 'underscore' );\n\nengine.global = {\n    title : 'global title'    \n}\n\nengine.renderString( '\u003c%-title %\u003e' ).then( res =\u003e {\n    console.log( res ); // output: global title\n} );\n```\n\n### engine.base\n\nThe base directory of template files\n\n```js\nconst engine = tengine( 'ejs' );\nengine.base = '/path/to/ejs/template/directory';\nengine.render( 'index.html' );\n```\n\n### engine.engine\n\nThe template engine instance.\n\n### engins.path( string name )\n\nTo get the full path of a template file in base direcotry.\n\n- name: the file name of the template file.\n\n### engine.context( object data )\n\nTo get the context data which will includes the global variables if exists.\n\n- the local context for compiling the template.\n\n### engine.configure( object options )\n\nConfiguring the template engines.\n\n### engine.render( string file, object context )\n\nRendering a template file.\n\n - file: the template file name.\n - context: the context for the template\n\n### engine.renderString( string str, object context )\n\nRendering template string.\n\n - str: the template string\n - context: the context for compiling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvchengbin%2Ftengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvchengbin%2Ftengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvchengbin%2Ftengine/lists"}