{"id":16434793,"url":"https://github.com/zce/node-xtemplate","last_synced_at":"2025-07-18T03:34:25.475Z","repository":{"id":14755854,"uuid":"77009573","full_name":"zce/node-xtemplate","owner":"zce","description":"A node.js wrapper around xtemplate engine","archived":false,"fork":false,"pushed_at":"2023-03-16T13:52:09.000Z","size":53,"stargazers_count":2,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T05:39:15.462Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zce.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"zce"}},"created_at":"2016-12-21T02:44:32.000Z","updated_at":"2019-10-31T14:09:29.000Z","dependencies_parsed_at":"2024-10-28T15:30:14.155Z","dependency_job_id":"5fd689d9-e949-405e-9519-afeebc4cb30b","html_url":"https://github.com/zce/node-xtemplate","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zce/node-xtemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fnode-xtemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fnode-xtemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fnode-xtemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fnode-xtemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zce","download_url":"https://codeload.github.com/zce/node-xtemplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fnode-xtemplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265696721,"owners_count":23812832,"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-10-11T08:50:09.095Z","updated_at":"2025-07-18T03:34:25.455Z","avatar_url":"https://github.com/zce.png","language":"JavaScript","funding_links":["https://github.com/sponsors/zce"],"categories":[],"sub_categories":[],"readme":"# Node xTemplate\n\n[![NPM version][npm-image]][npm-url]\n[![NPM download][download-image]][download-url]\n[![Build Status][travis-image]][travis-url]\n[![Dependency Status][dependency-image]][dependency-url]\n[![devDependency Status][devdependency-image]][devdependency-url]\n[![Code Style][style-image]][style-url]\n\n[npm-image]: https://badge.fury.io/js/node-xtemplate.svg\n[npm-url]: https://npmjs.org/package/node-xtemplate\n[download-image]: https://img.shields.io/npm/dm/node-xtemplate.svg\n[download-url]: https://npmjs.org/package/node-xtemplate\n[travis-image]: https://travis-ci.org/zce/node-xtemplate.svg?branch=master\n[travis-url]: https://travis-ci.org/zce/node-xtemplate\n[dependency-image]: https://david-dm.org/zce/node-xtemplate/status.svg\n[dependency-url]: https://david-dm.org/zce/node-xtemplate\n[devdependency-image]: https://david-dm.org/zce/node-xtemplate/dev-status.svg\n[devdependency-url]: https://david-dm.org/zce/node-xtemplate?type=dev\n[style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[style-url]: http://standardjs.com/\n\n\u003e A node.js wrapper around xtemplate engine\n\n\n## Install\n\n```sh\n$ npm install --save node-xtemplate\n```\n\n\n## Usage\n\ndemo.xtpl\n```html\n\u003cp\u003e{{ message }}\u003c/p\u003e\n```\n\ndemo.js\n\n```js\nconst xTemplate = require('node-xtemplate')\n\n// callback\nxTemplate.render(path.resolve(__dirname, 'demo.xtpl'), {\n  message: 'hello world'\n}, function (err, result) {\n  // result =\u003e \u003cp\u003ehello world\u003c/p\u003e\n})\n\n// or promise\nxTemplate\n  .render(path.resolve(__dirname, 'demo.xtpl'), { message: 'hello world' })\n  .then(function (result) {\n    // result =\u003e \u003cp\u003ehello world\u003c/p\u003e\n  })\n  .catch(function (err) {\n    // if err\n  })\n```\n\n\n## API\n\n### render(path, data[, options], callback)\n\n#### path\n\nType: `string`\n\nThe path of template file.\n\n#### data\n\nType: `object`\n\nThe template data.\n\n#### options\n\n##### extname\n\nType: `string`\n\n##### strict\n\nType: `boolean`\n\n##### catchError\n\nType: `boolean`\n\n##### cache\n\nType: `boolean`\n\n##### encoding\n\nType: `string`\u003cbr\u003e\nDefault: `utf-8`\n\n#### callback(err, result)\n\nType: `function`\n\nDone callback\n\n\n## License\n\n[MIT](LICENSE) © [汪磊](http://github.com/zce)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzce%2Fnode-xtemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzce%2Fnode-xtemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzce%2Fnode-xtemplate/lists"}