{"id":21485693,"url":"https://github.com/bitofsky/async-jstemplate","last_synced_at":"2025-03-17T10:08:54.146Z","repository":{"id":9661644,"uuid":"11600838","full_name":"bitofsky/Async-JSTemplate","owner":"bitofsky","description":"AJST : Asynchronous JavaScript Template","archived":false,"fork":false,"pushed_at":"2017-08-10T12:16:02.000Z","size":378,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T22:22:56.327Z","etag":null,"topics":["ajax","javascript","javascript-templates","promise","tpl"],"latest_commit_sha":null,"homepage":"http://bitofsky.github.io/Async-JSTemplate/","language":"TypeScript","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/bitofsky.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":"2013-07-23T05:59:19.000Z","updated_at":"2024-05-14T13:37:25.000Z","dependencies_parsed_at":"2022-07-07T19:27:34.323Z","dependency_job_id":null,"html_url":"https://github.com/bitofsky/Async-JSTemplate","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/bitofsky%2FAsync-JSTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitofsky%2FAsync-JSTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitofsky%2FAsync-JSTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitofsky%2FAsync-JSTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitofsky","download_url":"https://codeload.github.com/bitofsky/Async-JSTemplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014136,"owners_count":20383715,"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":["ajax","javascript","javascript-templates","promise","tpl"],"created_at":"2024-11-23T13:17:07.302Z","updated_at":"2025-03-17T10:08:54.110Z","avatar_url":"https://github.com/bitofsky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"AJST : Asynchronous JavaScript Template\n================\n\n[![npm version](https://badge.fury.io/js/ajst.svg)](https://badge.fury.io/js/ajst)\n\n# Introduce\n\nAJST is a JavaScript template engine based on Promise A+.\n\nTemplate files and data are called asynchronously at the required time to generate Output.\n\n\n# Features\n\n1. The syntax is similar to PHP. **\u0026lt;? ... ?\u0026gt;**\n2. It uses **pure JavaScript** without a dedicated template syntax or API.\n3. If necessary, the template is automatically loaded.\n4. In the template file you may refer to a different template. Output is returned when all the necessary templates are ready.\n5. It uses [ES6 Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise)\n\n# Install\n\n```\nnpm install ajst --save\n```\n\n## Use ES-Module (like TypeScript)\n```javascript\nimport * as AJST from 'ajst'; // module\n\nAJST.get(Tpl_ID, data).then(output =\u003e\n  $('#output').html(output)\n);\n```\n\n## Use AMD (like RequireJS)\n```javascript\nrequirejs.config({\n  paths: {\n    ajst: 'path to ajst/dist/ajst' // ajst.js (for AMD bundle)\n  }\n})\nrequire(['ajst'], async AJST =\u003e {\n  const output = await AJST.get(Tpl_ID, data);\n  $('#output').html(output);\n});\n```\n\n# How to use\ntpl/hello.html\n```html\nHello, \u003c?include('tpl/world.html', {name: 'John Smith'})?\u003e\n```\ntpl/world.html\n```html\nworld! \u003c?=data.name?\u003e\n```\nindex.js\n```javascript\nAJST.get('tpl/hello.html').then(output =\u003e {\n  console.log(output); // Hello, world! John Smith\n})\n```\n\n# Demo\n\n@see [AJST Introduce \u0026 Test with Bootstrap 3](http://bitofsky.github.io/Async-JSTemplate/)\n\n# Browser Compatibility\n\n * IE9+ (IE9 requires [es6-shim](https://github.com/paulmillr/es6-shim))\n * Google Chrome\n * Safari\n * FireFox\n * Opera\n\n# Inspired by...\n\n * John Resig : [JavaScript Micro-Templating](http://ejohn.org/blog/javascript-micro-templating/)\n * blueimp : [JavaScript-Templates](https://github.com/blueimp/JavaScript-Templates/)\n\n# License\n\n(The MIT License)\n\nCopyright (c) 2013 Bum-seok Hwang \u003cbitofsky@naver.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitofsky%2Fasync-jstemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitofsky%2Fasync-jstemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitofsky%2Fasync-jstemplate/lists"}