https://github.com/wmartinmimi/spa-y
A simple and lightweight js library for creating dynamic html from json endpoints using html templates.
https://github.com/wmartinmimi/spa-y
html-templating js json lightweight mit-license
Last synced: about 2 months ago
JSON representation
A simple and lightweight js library for creating dynamic html from json endpoints using html templates.
- Host: GitHub
- URL: https://github.com/wmartinmimi/spa-y
- Owner: wmartinmimi
- License: mit
- Created: 2023-09-03T13:06:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-03T13:14:31.000Z (almost 3 years ago)
- Last Synced: 2025-03-27T08:22:05.333Z (about 1 year ago)
- Topics: html-templating, js, json, lightweight, mit-license
- Language: HTML
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# spa-y
A simple and lightweight js library for creating dynamic html from json endpoints using html templates.
```html
${body}
spay.get("/example.json", "#out", "#template");
```
## Imports
```html
```
## Example usage
```html
${header}
${body}
// spay.get( url, destination, template )
// IMPORTANT: JSON ENDPOINT SHOULD HAVE SANITIZED OUTPUT
spay.get("/example.json", "#example", "#template");
/* example.json
{
"header": "Hello dev",
"body": "Welcome to SPA-Y"
}
*/
/* outputs
<h2>Hello dev</h2>
<p>Welcome to SPA-Y</p>
*/
```
For full html, see [/example.html](/example.html).
For more advanced usage, see [/advanced.html](/advanced.html).
## Issues and Pull Requests
Any issues or pull requests are welcomed.
## License
Licensed under ```MIT License```.