{"id":19190462,"url":"https://github.com/mdxprograms/pagify-it","last_synced_at":"2025-08-21T10:10:36.717Z","repository":{"id":95270556,"uuid":"121041209","full_name":"mdxprograms/pagify-it","owner":"mdxprograms","description":"Add routing to your React app in one minute.","archived":false,"fork":false,"pushed_at":"2018-01-22T14:04:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T05:33:01.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/mdxprograms.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":"2018-02-10T18:15:34.000Z","updated_at":"2019-09-13T05:50:12.000Z","dependencies_parsed_at":"2023-04-13T00:03:55.782Z","dependency_job_id":null,"html_url":"https://github.com/mdxprograms/pagify-it","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mdxprograms/pagify-it","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpagify-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpagify-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpagify-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpagify-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdxprograms","download_url":"https://codeload.github.com/mdxprograms/pagify-it/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpagify-it/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268215611,"owners_count":24214365,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T11:34:19.732Z","updated_at":"2025-08-01T11:34:31.889Z","avatar_url":"https://github.com/mdxprograms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pagify-it\n\n# Installation\n\n`yarn add page pagify-it`\n\n# Usage\n\n```javascript\nimport Router, { Link, navigate, redirect } from 'pagify-it';\n\nimport Root from './root';\n\nconst Foo = () =\u003e null;\nconst Bar = () =\u003e null;\n\nconst routes = {\n  '/': Root,\n  '/foo': Foo,\n  '/bar/:id': Bar,\n  '*': () =\u003e \u003cdiv\u003e404\u003c/div\u003e\n};\n\nconst App = () =\u003e \u003cRouter {...{ routes }} /\u003e; // you can pass an `opts` prop too\n\n// helpers:\n// use \u003cLink to=\"/posts\" /\u003e to display a link \u003ca /\u003e\n\n// methods available:\n// navigate('/posts'), to navigate to a certain path\n// redirect('/login'), to redirect to a certain path\n\n// context: each rendered route will have a `ctx` prop with some metadata\n```\n\n# Documentation\n\nSee [Page.js](https://visionmedia.github.io/page.js/). This package is meant for small projects and for quick prototyping, consider something more sophisticated if you intend to build a larger product.\n\n# Example\n\n```javascript\nimport React from 'react';\nimport { render } from 'react-dom';\n\nimport Router, { Link } from 'pagify-it';\n\nconst Root = () =\u003e (\n  \u003cdiv style={styles.container}\u003e\n    \u003ch1\u003eRoot\u003c/h1\u003e\n    \u003cLink to=\"/posts\"\u003ePosts\u003c/Link\u003e\n  \u003c/div\u003e\n);\n\nconst Posts = () =\u003e (\n  \u003cdiv style={styles.container}\u003e\n    \u003ch1\u003ePosts\u003c/h1\u003e\n    \u003cLink to=\"/posts/1\"\u003ePost #1\u003c/Link\u003e\n    \u003cLink to=\"/posts/2\"\u003ePost #2\u003c/Link\u003e\n    \u003cLink to=\"/posts/3\"\u003ePost #3\u003c/Link\u003e\n    \u003cLink to=\"/posts/new\"\u003eNew post\u003c/Link\u003e\n    \u003cLink to=\"/\"\u003eBack to root\u003c/Link\u003e\n  \u003c/div\u003e\n);\n\nconst New = () =\u003e (\n  \u003cdiv style={styles.container}\u003e\n    \u003ch1\u003eNew post\u003c/h1\u003e\n    \u003cLink to=\"/posts\"\u003eBack to posts\u003c/Link\u003e\n  \u003c/div\u003e\n);\n\nconst Post = props =\u003e (\n  \u003cdiv style={styles.container}\u003e\n    \u003ch1\u003ePost #{props.ctx.params.id}\u003c/h1\u003e\n    \u003cLink to=\"/posts\"\u003eBack to posts\u003c/Link\u003e\n  \u003c/div\u003e\n);\n\nconst styles = {\n  container: { display: 'flex', flexDirection: 'column' }\n};\n\nconst routes = {\n  '/': Root,\n  '/posts': Posts,\n  '/posts/new': New,\n  '/posts/:id': Post,\n  '*': () =\u003e \u003cdiv\u003e404\u003c/div\u003e\n};\n\nconst App = () =\u003e \u003cRouter {...{ routes }} /\u003e;\n\nrender(\u003cApp /\u003e, document.getElementById('root'));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Fpagify-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdxprograms%2Fpagify-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Fpagify-it/lists"}