{"id":21207143,"url":"https://github.com/CodeDynasty-dev/Naxtjs","last_synced_at":"2025-07-10T08:33:54.245Z","repository":{"id":163692570,"uuid":"637361150","full_name":"Uiedbook/Naxtjs","owner":"Uiedbook","description":"Naxt - SSR library for server-side javascript 🚀","archived":false,"fork":false,"pushed_at":"2024-09-02T02:17:42.000Z","size":343,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-09T07:42:38.980Z","etag":null,"topics":["cradova","front-end-development","server-side-rendering","ssr","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Uiedbook.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-07T10:20:09.000Z","updated_at":"2024-09-02T02:17:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1440ba6-965a-40b4-9af2-6c08cb8b6428","html_url":"https://github.com/Uiedbook/Naxtjs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uiedbook%2FNaxtjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uiedbook%2FNaxtjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uiedbook%2FNaxtjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uiedbook%2FNaxtjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Uiedbook","download_url":"https://codeload.github.com/Uiedbook/Naxtjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225629836,"owners_count":17499295,"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":["cradova","front-end-development","server-side-rendering","ssr","web"],"created_at":"2024-11-20T20:57:53.631Z","updated_at":"2025-07-10T08:33:48.914Z","avatar_url":"https://github.com/Uiedbook.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/uiedbook/Naxtjs\"\u003e\n    \u003cimg src=\"naxt.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch1 align=\"center\"\u003eNaxt\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n  Naxt - SSR library for server-side javascript \n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/uiedbook/Naxtjs#examples\"\u003e\u003cstrong\u003eExplore the 🎙️ docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://t.me/UiedbookHQ\"\u003eJoin Community\u003c/a\u003e\n    .\n    \u003ca href=\"https://github.com/uiedbook/Naxtjs/issues\"\u003eReport Bug\u003c/a\u003e\n    .\n    \u003ca href=\"https://github.com/uiedbook/Naxtjs/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n![Contributors](https://img.shields.io/github/contributors/Uiedbook/Naxtjs?color=dark-green) ![Issues](https://img.shields.io/github/issues/Uiedbook/Naxtjs) ![License](https://img.shields.io/github/license/Uiedbook/Naxtjs)\n[![npm Version](https://img.shields.io/npm/v/naxtjs.svg)](https://www.npmjs.com/package/Naxtjs)[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/uiedbook/Naxt.js/blob/next/contributing.md)![Forks](https://img.shields.io/github/forks/uiedbook/Naxtjs?style=social) ![Stargazers](https://img.shields.io/github/stars/uiedbook/naxtjs?style=social)\n\n# Contents\n\n- [What is Naxtjs](#what-is-Naxtjs)\n- [Installation](#installation)\n- [Examples](#example)\n- [Getting Help](#getting-help)\n\n## What is Naxtjs?\n\nNaxtjs is a javascript lib for server rending html similar to htmx.\n\nBut Naxtjs is rather light weight and simple. let see.\n\nNaxt follows the [VJS specification](https://github.com/Uiedbook/cradova/blob/main/VJS_spec)\n\nIf you want support my telegram group (link below).\n\n## Installation\n\n### npm\n\n```bash\nnpm i naxtjs\n```\n\n## Examples\n\n## A basic component in Naxtjs:\n\n```js\nimport { div, h1, naxt } from \"naxtjs\";\n\nfunction Hello(name) {\n  return h1(\"Hello \" + name, {\n    className: \"title\",\n    style: {\n      color: \"grey\",\n    },\n  });\n}\n\nconst html = naxt.compile(div(Hello(\"peter\"), Hello(\"joe\"))); // html string\n\napp.get(\"/\", (req, res) =\u003e {\n  res.send(html);\n});\n```\n\n## client usage\n\n```html\n\u003c!-- Load --\u003e\n\u003cdiv data-naxt-load=\"/home.html\"\u003e\u003c/div\u003e\n```\n\nIn the above code, Naxtjs will immediately replace the div with the html responces from the data-naxt-load attribute.\n\nIf no html comes, nothing happens.\n\n```html\n\u003c!-- Onclick --\u003e\n\u003ca\n  data-naxt-event=\"main\"\n  data-naxt-link=\"/home.html\"\n  data-naxt-event-type=\"click\"\n\u003e\n  \u003cspan class=\"title\"\u003eHome\u003c/span\u003e\n\u003c/a\u003e\n```\n\nIn ths above Naxtjs will replace the contents of the element with id \"main\" with the html responces from the href when the a tag is clicked.\n\nIf no html comes, nothing happens.\n\n```js\nconst updateMain = (type, key) =\u003e {\n  // ? params =   element, href\n  naxt.update(\n    document.getElementById(\"main\"),\n    \"/o/search/?type=\" +\n      type +\n      \"\u0026q=\" +\n      document.getElementById(\"search\").value +\n      \"\u0026kq=\" +\n      key\n  );\n};\n```\n\nIn ths above function, Naxtjs will replace the contents of the element with the html responces from the href when the fucntion is called.\n\nIf no html comes, nothing happens.\n\nSee line 5 of dist/client.min.js to see how Naxtjs handles request headers for security measures when access content from servers\n\n## Server Usage\n\n```js\nexport const LoginPage = (req, res) =\u003e {\n  const html = naxt.compile(\n    div(\n      img({\n        src: \"./logo.png\",\n        style: { maxWidth: \"100px\", margin: \"4rem auto\" },\n      }),\n      h1(\"Login\"),\n      input({ placeholder: \"email\", id: \"email\" }),\n      input({ placeholder: \"password\", id: \"password\" }),\n      button(\"Login\", {\n        id: \"login\",\n        style: {\n          color: \"black\",\n        },\n      })\n    )\n  );\n  res.send(html);\n};\n```\n\nThere's a difference between naxt.compile and naxt.pile\n\nBoth compiles javascript to html, but can only be used on the server, but only naxt.compile can load naxtjs to the dom.\nSo if you are using naxt.pile on a page that has no naxtjs in the window yet, you will get errors\n\n## Getting Help and Contributing\n\nTo get help on Naxtjs, join [Telegram](https://t.me/uiedbookHQ) Community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeDynasty-dev%2FNaxtjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodeDynasty-dev%2FNaxtjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeDynasty-dev%2FNaxtjs/lists"}