{"id":29436868,"url":"https://github.com/stone-foundation/stone-js-router","last_synced_at":"2025-07-13T05:06:55.845Z","repository":{"id":190562570,"uuid":"682889753","full_name":"stone-foundation/stone-js-router","owner":"stone-foundation","description":"Universal router for modern JavaScript and TypeScript apps. Works seamlessly across Node.js and browser environments. Built for serverless, SSR, and SPA with a functional, composable API.","archived":false,"fork":false,"pushed_at":"2025-06-12T05:33:37.000Z","size":371,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T05:36:49.350Z","etag":null,"topics":["context-aware","csr","javascript","js-router","official-stonejs","spa","ssr","stone-foundation","stonejs","ts-route","typescript"],"latest_commit_sha":null,"homepage":"https://stonejs.dev","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/stone-foundation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-25T05:38:01.000Z","updated_at":"2025-06-12T05:14:10.000Z","dependencies_parsed_at":"2023-08-25T08:24:24.622Z","dependency_job_id":"7c6e818c-3e13-4b27-81e8-392337e8c08c","html_url":"https://github.com/stone-foundation/stone-js-router","commit_stats":null,"previous_names":["noowow-community/router","stonemjs/router","stone-foundation/stone-js-router"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stone-foundation/stone-js-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stone-foundation","download_url":"https://codeload.github.com/stone-foundation/stone-js-router/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-router/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265091734,"owners_count":23710033,"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":["context-aware","csr","javascript","js-router","official-stonejs","spa","ssr","stone-foundation","stonejs","ts-route","typescript"],"created_at":"2025-07-13T05:06:54.978Z","updated_at":"2025-07-13T05:06:55.795Z","avatar_url":"https://github.com/stone-foundation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stone.js - Router\n\n[![npm](https://img.shields.io/npm/l/@stone-js/router)](https://opensource.org/licenses/MIT)\n[![npm](https://img.shields.io/npm/v/@stone-js/router)](https://www.npmjs.com/package/@stone-js/router)\n[![npm](https://img.shields.io/npm/dm/@stone-js/router)](https://www.npmjs.com/package/@stone-js/router)\n![Maintenance](https://img.shields.io/maintenance/yes/2025)\n[![Build Status](https://github.com/stone-foundation/stone-js-router/actions/workflows/main.yml/badge.svg)](https://github.com/stone-foundation/stone-js-router/actions/workflows/main.yml)\n[![Publish Package to npmjs](https://github.com/stone-foundation/stone-js-router/actions/workflows/release.yml/badge.svg)](https://github.com/stone-foundation/stone-js-router/actions/workflows/release.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=stone-foundation_stone-js-router\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=stone-foundation_stone-js-router)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=stone-foundation_stone-js-router\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=stone-foundation_stone-js-router)\n[![Security Policy](https://img.shields.io/badge/Security-Policy-blue.svg)](./SECURITY.md)\n[![CodeQL](https://github.com/stone-foundation/stone-js-router/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/stone-foundation/stone-js-router/security/code-scanning)\n[![Dependabot Status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg)](https://github.com/stone-foundation/stone-js-router/network/updates)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\nStone.js router for both Node.js and browser environments, designed for serverless applications.\n\n---\n\n## Overview\n\n**Stone Router** is a high-performance, universal router designed to work seamlessly across **Node.js** and **browser environments**. As a core part of the [Stone.js](https://stonejs.dev) framework, it enables robust, declarative, and composable route handling for **serverless**, **SSR**, and **SPA** applications.\n\n## Key Features\n\n- **Universal**: Works on both backend and frontend (Node.js, browsers, SSR apps).\n- **Composable**: Supports route builders, chaining, and nested route structures.\n- **Context-Aware**: Routes are designed to respond to the execution context.\n- **Type-Safe \u0026 Declarative**: Built with TypeScript-first principles.\n- **Fast \u0026 Lightweight**: Optimized for high-performance and minimal overhead.\n- **Model Binding**: Automatically inject models and bindings into routes.\n- **Flexible Middleware System**: Apply middleware globally or per route.\n- **Regex and Dynamic Params**: Advanced matching for custom use cases.\n- **Error Handling \u0026 Fallbacks**: Integrated with the event lifecycle.\n- **Smart Defaults**: Supports defaults, route rules, redirect handling, etc.\n\n## Installation\n\n```bash\nnpm install @stone-js/router\n```\n\n\u003e [!IMPORTANT]\n\u003e This package is **pure ESM**. Ensure your `package.json` includes `\"type\": \"module\"` or configure your bundler appropriately.\n\n## Usage\n\nStone Router exposes a functional/declarative API that allows defining, composing, and dispatching routes easily. \nIt is designed to be used in both server and client contexts, making it ideal for modern web applications that require a unified routing solution.\nIt fully integrates with the **event system** of Stone.js through `IncomingEvent` and `OutgoingResponse`.\n\n```ts\nimport { IncomingEvent } from '@stone-js/core'\nimport { defineRoutes } from '@stone-js/router'\n\nexport const routes = defineRoutes([\n  {\n    method: 'GET',\n    path: '/users/:id',\n    handler: async (event: IncomingEvent) =\u003e {\n      return { body: `User ID: ${event.get('id') }` }\n    }\n  }\n])\n```\n\n## Learn More\n\nThis package is part of the Stone.js ecosystem, a modern JavaScript framework built around the Continuum Architecture.\n\nExplore the full documentation: https://stonejs.dev\n\n## API documentation\n\n* [API](https://github.com/stone-foundation/stone-js-router/blob/main/docs)\n\n## Contributing\n\nSee [Contributing Guide](https://github.com/stone-foundation/stone-js-router/blob/main/CONTRIBUTING.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-foundation%2Fstone-js-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstone-foundation%2Fstone-js-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-foundation%2Fstone-js-router/lists"}