{"_rev":"3-01cb9948605438089868e5ba0b4048a6","time":{"created":"2024-12-09T10:27:17.500Z","modified":"2024-12-09T10:27:18.153Z","0.1.0":"2024-12-09T04:05:39.010Z","0.1.1":"2024-12-09T10:27:17.802Z"},"_id":"@dififa/spa-router","name":"@dififa/spa-router","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@dififa/spa-router","version":"0.1.1","description":"A minimalistic version of router for SPA applications.","author":{"name":"Yulmizar"},"module":"index.js","type":"module","repository":{"type":"git","url":"git+https://github.com/ulmzr/spa-router.git"},"bugs":{"url":"https://github.com/ulmzr/spa-router/issues"},"homepage":"https://github.com/ulmzr/spa-router#readme","_id":"@dififa/spa-router@0.1.1","gitHead":"db0dd600cf31fc5b7c2300fa3bddc552775ff73b","_nodeVersion":"22.11.0","_npmVersion":"10.9.1","dist":{"integrity":"sha512-Ekzk3nXduNxKpDWUWVxR1SccGYI4GNJQJLP39vu+7DGX5XpbEsruNj7HcXUcXtqMe4xxRUo/JzIKUPR6aldC0w==","shasum":"28f80c1b029e3dccd2b1a8e5a4b182c8b28ceba3","tarball":"https://registry.npmjs.org/@dififa/spa-router/-/spa-router-0.1.1.tgz","fileCount":4,"unpackedSize":5343,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCA9uQImsokB+w7hjO2YT4aOexatHJs9M3RGNnghaBv7wIhANvRGT0Q8tcO10bqbaCkSfGwGawB4FrO0K1r4HbkeGr7"}]},"_npmUser":{"name":"yulmizar","email":"yulmizar@gmail.com"},"directories":{},"maintainers":[{"name":"yulmizar","email":"yulmizar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spa-router_0.1.1_1733740037622_0.4584678724132405"},"_hasShrinkwrap":false}},"maintainers":[{"name":"yulmizar","email":"yulmizar@gmail.com"}],"description":"A minimalistic version of router for SPA applications.","homepage":"https://github.com/ulmzr/spa-router#readme","repository":{"type":"git","url":"git+https://github.com/ulmzr/spa-router.git"},"author":{"name":"Yulmizar"},"bugs":{"url":"https://github.com/ulmzr/spa-router/issues"},"readme":"# spa-router\r\n\r\nA minimalistic version of router for SPA application.\r\n\r\nUsage example with MalinaJS:\r\n\r\nIn Script section,\r\n\r\n```js\r\nimport Router from '...'\r\n\r\nlet cmp, params = {}, query = {}\r\n\r\nconst router = new Router()\r\n\r\nrouter\r\n    .on('/', import('./Home.xht'))\r\n    .on('/about/:name', import('./About.xht'))\r\n    .on('/setting', import('./Setting.xht'))\r\n    .on('/users/:id', import('./Users.xht'))\r\n    .on('/posts/:postId/comments', import('./Posts.xht'))\r\n    .on404(import('./404.xht'))\r\n    .listen((matchedRoute) => {\r\n        ({ cmp, params, query } = matchedRoute)\r\n    })\r\n```\r\n\r\nIn Body section,\r\n\r\n```html\r\n<ul>\r\n    <li><a href=\"/\">Home</a></li>\r\n    <li><a href=\"/about/me\">About</a></li>\r\n    <li><a href=\"/setting?about=setting\">Setting</a></li>\r\n    <li><a href=\"/users/123?active=true\">User 123</a></li>\r\n    <li><a href=\"/posts/456/comments?sort=latest\">Comments for Post 456</a></li>\r\n</ul>\r\n\r\n{#if cmp}\r\n    <component:cmp {params} {query} />\r\n{/if}\r\n```\r\n","readmeFilename":"README.md"}