{"id":16346833,"url":"https://github.com/pixcai/es6-template-string","last_synced_at":"2025-10-26T02:30:19.287Z","repository":{"id":57227236,"uuid":"66931334","full_name":"pixcai/es6-template-string","owner":"pixcai","description":"Easy and small template engine for the browser and nodejs","archived":false,"fork":false,"pushed_at":"2020-10-10T03:48:37.000Z","size":8,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T13:11:16.633Z","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/pixcai.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":"2016-08-30T10:34:02.000Z","updated_at":"2022-07-18T06:10:12.000Z","dependencies_parsed_at":"2022-08-25T14:41:12.331Z","dependency_job_id":null,"html_url":"https://github.com/pixcai/es6-template-string","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/pixcai%2Fes6-template-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixcai%2Fes6-template-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixcai%2Fes6-template-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixcai%2Fes6-template-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixcai","download_url":"https://codeload.github.com/pixcai/es6-template-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238241444,"owners_count":19439767,"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-11T00:37:48.010Z","updated_at":"2025-10-26T02:30:18.770Z","avatar_url":"https://github.com/pixcai.png","language":"JavaScript","readme":"# es6-template-string\nEasy and small template engine for the browser and nodejs\n\n[![npm](https://img.shields.io/npm/v/es6-template-string.svg?style=flat-square)](https://www.npmjs.com/package/es6-template-string)\n[![npm](https://img.shields.io/npm/dt/es6-template-string.svg?style=flat-square)](https://www.npmjs.com/package/es6-template-string)\n[![npm](https://img.shields.io/npm/l/es6-template-string.svg?style=flat-square)](https://www.npmjs.com/package/es6-template-string)\n\n# Install\n```shell\nnpm install --save es6-template-string\n```\n\n# API\n### render(str[, locals])\nRender template `str` with variable `locals`\n\nExample:\n```js\nvar template = require('es6-template-string');\n\ntemplate.render('Node Version: ${ process.version }');\n// It equals to\ntemplate('Node Version: ${ process.version }');\n```\n\n### compile(str)\nCompile `str` and return a function that accept one parameters: `locals`\n\nExample:\n```js\nvar template = require('es6-template-string');\n\nvar logNodeVersion = template.compile('Node Version: ${ process.version }');\nlogNodeVersion();\n```\n\n# Usage\n```js\nvar template = require('es6-template-string');\n\n// This is hello, world\ntemplate('This is ${vars}', {vars: 'hello, world'});\n\n// This is 3\ntemplate('This is ${m + n}', {m: 1, n: 2});\n// or\nvar m = 1, n = 2;\ntemplate('This is ${m + n}');\n\nvar plus = template.compile('This is ${m + n}');\n// This is 5\nplus({m: 1, n: 4});\n```\n\n# License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixcai%2Fes6-template-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixcai%2Fes6-template-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixcai%2Fes6-template-string/lists"}