An open API service indexing awesome lists of open source software.

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.

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```.