{"id":17446024,"url":"https://github.com/jamen/hyperapp-page","last_synced_at":"2025-07-06T22:33:59.117Z","repository":{"id":96784727,"uuid":"183108682","full_name":"jamen/hyperapp-page","owner":"jamen","description":"  A hyperapp router with prerendering and metadata support.","archived":false,"fork":false,"pushed_at":"2019-04-23T23:11:59.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T01:48:18.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamen.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2019-04-23T23:08:36.000Z","updated_at":"2021-12-19T15:27:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb11beed-2bf3-492d-9eee-bd95a40b853c","html_url":"https://github.com/jamen/hyperapp-page","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/jamen%2Fhyperapp-page","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fhyperapp-page/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fhyperapp-page/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fhyperapp-page/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/hyperapp-page/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246802594,"owners_count":20836365,"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":[],"created_at":"2024-10-17T18:20:50.532Z","updated_at":"2025-04-02T10:43:11.942Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @finepoint/hyperapp-page\n\nA hyperapp router with prerendering and metadata support.\n\n## Install\n\n```\nnpm i @finepoint/hyperapp-page\n```\n\n## Usage\n\nThe module exports two actions, `routeInit(routes)` and `route(path)`. You call `routeInit` when the app is created, and you call `route` to change the page. There is a `Link` component that calls `route` for you. Finally, a `getPage(state)` gets the routed view.\n\nHere is a small demo of all the pieces together:\n\n```js\nimport { h, app } from 'hyperapp'\nimport { routeInit, route, Link, getPage } from '@finepoint/hyperapp-page'\n\nconst state = {\n    sample: 'Hello'\n}\n\nconst actions = {\n    update: d =\u003e d,\n    state: () =\u003e s =\u003e s,\n    routeInit,\n    route\n}\n\nconst view = state =\u003e getPage(state)\n\nconst Home = () =\u003e\n    \u003cdiv\u003e\n        Home page.\n        \u003cLink href='/foo'\u003eGo to /foo\u003c/Link\u003e\n    \u003c/div\u003e\n\nconst Foo = () =\u003e\n    \u003cdiv\u003eFoo page\u003c/div\u003e\n\nconst Lost = () =\u003e\n    \u003cdiv\u003e\n        404 page\n        \u003cLink href='/'\u003eReturn home.\u003c/Link\u003e\n    \u003c/div\u003e\n\nconst routes = {\n    '/': Home,\n    '/foo': Foo,\n    [false]: Lost\n}\n\nconst main = app(state, actions, view, document.body)\n\nmain.routeInit(routes)\n```\n\nNote: The `update` and `state` actions are required for the imported actions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fhyperapp-page","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fhyperapp-page","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fhyperapp-page/lists"}