{"id":24906238,"url":"https://github.com/lkgit1/jquery.poseidon","last_synced_at":"2025-10-16T18:30:42.604Z","repository":{"id":69888257,"uuid":"162881496","full_name":"lkgit1/jquery.poseidon","owner":"lkgit1","description":"Lightweight jQuery templating library with ajax support","archived":false,"fork":false,"pushed_at":"2023-11-29T16:27:44.000Z","size":386,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T05:02:49.845Z","etag":null,"topics":["ajax","api-client","jquery","jquery-poseidon-plugin","polling-support","templating"],"latest_commit_sha":null,"homepage":"","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/lkgit1.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}},"created_at":"2018-12-23T10:28:28.000Z","updated_at":"2023-11-29T16:26:17.000Z","dependencies_parsed_at":"2023-11-29T17:47:41.952Z","dependency_job_id":null,"html_url":"https://github.com/lkgit1/jquery.poseidon","commit_stats":null,"previous_names":["lkgit1/jquery.poseidon","danielthegeek/jquery.poseidon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkgit1%2Fjquery.poseidon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkgit1%2Fjquery.poseidon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkgit1%2Fjquery.poseidon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkgit1%2Fjquery.poseidon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lkgit1","download_url":"https://codeload.github.com/lkgit1/jquery.poseidon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236738657,"owners_count":19196962,"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","api-client","jquery","jquery-poseidon-plugin","polling-support","templating"],"created_at":"2025-02-02T00:39:14.140Z","updated_at":"2025-10-16T18:30:42.048Z","avatar_url":"https://github.com/lkgit1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery.Poseidon\nLightweight jQuery templating plugin with ajax support for consuming APIs and rendering data to DOM\n\n## Overview\nThe jQuery Poseidon plugin allows you to easily submit forms via AJAX, make API requests and even render templates on the fly. The main method, Poseidon, gathers information from the form element to determine how to manage the form submit process.\n```javascript\n$.poseidon('form', {\n\tonSucess() {\n\t\talert('Form submitted!');\n\t}\n});\n```\n\n### Making API requests:\n```javascript\n// Make a POST request to an API endpoint\n$.poseidon.request('https://reqres.in/api/users');\n\n// Make a GET request to an API endpoint\n$.poseidon.default.method = 'GET';\n$.poseidon.request('https://reqres.in/api/users');\n\n// Make a GET request to an API endpoint with authentication\n$.poseidon.default.method = 'GET'; // Set the request type\n\n// Warning: API keys aren't meant to be exposed on the client, you should only \n// use this on the backend e.g NodeJS\n$.poseidon.default.headers = {\n\t'X-API-KEY': '910091092129ABRJS'\n};\n\n// Make request\n$.poseidon.request('https://reqres.in/api/users');\n\n// Output\n{  \n   \"page\":1,\n   \"per_page\":3,\n   \"total\":12,\n   \"total_pages\":4,\n   \"data\":[  \n      {  \n         \"id\":1,\n         \"first_name\":\"George\",\n         \"last_name\":\"Bluth\",\n         \"avatar\":\"https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg\"\n      },\n      {  \n         \"id\":2,\n         \"first_name\":\"Janet\",\n         \"last_name\":\"Weaver\",\n         \"avatar\":\"https://s3.amazonaws.com/uifaces/faces/twitter/josephstein/128.jpg\"\n      },\n      {  \n         \"id\":3,\n         \"first_name\":\"Emma\",\n         \"last_name\":\"Wong\",\n         \"avatar\":\"https://s3.amazonaws.com/uifaces/faces/twitter/olegpogodaev/128.jpg\"\n      }\n   ]\n}\n```\n\n### Rendering data to a template:\n```javascript\n// HTML markup with template literals in mustache brackets\nconst template = '\u003cdiv\u003eHello {{ name }}\u003c/div\u003e'; // Could also be $('template').html();\n\n// Data to replace with template literals\nconst data = {\n\tname: 'DanielTheGeek'\n};\n\n// Store the rendered template to a var so we can append later\nconst renderedTemplate = $.poseidon.render(template, data);\n\n// Append rendered template to a DOM element\n$('.target').append( renderedTemplate );\n```\n\n### Rendering API payload to a template\n```javascript\n// Markup\n\u003cdiv id=\"users\"\u003e\u003c/div\u003e\n\u003cscript id=\"users-list-template\" type=\"text/x-poseidon-template\"\u003e\n\t\u003cdiv class=\"user\"\u003e\n\t\t\u003cdiv class=\"image\"\u003e\n\t\t\t\u003cimg src=\"{{ avatar }}\"\u003e\n\t\t\u003c/div\u003e\n\t\t\u003cdiv\u003e{{ first_name }} {{ last_name }}\u003c/div\u003e\n\t\u003c/div\u003e\n\u003c/script\u003e\n\n// In your JavaScript file\n$.poseidon.default.method = 'GET';\n$.poseidon.request('https://reqres.in/api/users', {\n\tonSuccess(data) {\n\t\tconst template = $('#users-list-template').html();\n\t\t\n\t\t$.each(data.data, function(index, value) {\n\t\t\tconst render = $.poseidon.render(template, value);\n\t\t\t$('#users').append(render);\n\t\t});\n\t}\n});\n```\n\n## Contributing\nWith your help, this plugin can be improved and nice features can be added quickly. To contribute:\n```\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n```\n\n## Compatibility\n* Requires jQuery 1.7.2 or later.  \n* Compatible with jQuery 2.\n* Compatible with jQuery 3.\n\n### Download\n## Yarn\n```bash\nyarn add jquery.poseidon\n```\n## NPM\n```bash\nnpm i jquery.poseidon\n```\n## Git\n```bash\ngit clone https://github.com/danielthegeek/jquery.poseidon.git\n```\n\n### CDN\nComing soon\n---\n\n## API\nComing soon\n\n## License\nThis project is licensed under the MIT license:\n* [MIT](LICENSE-MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkgit1%2Fjquery.poseidon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkgit1%2Fjquery.poseidon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkgit1%2Fjquery.poseidon/lists"}