open-index/open-npm huggingface dataset:
npm package: @nicnocquee/next-type-safe-routing
Description: Utility to make next.js routing type safe.
Latest version: 0.0.4

# Type-safe Next Routing

Utility to make next.js routing type safe. Based on https://www.flightcontrol.dev/blog/fix-nextjs-routing-to-have-full-type-safety. The project is initiated with [typescript-starter](https://github.com/bitjson/typescript-starter).

## Installation

```
npm i next-type-safe-routing
```

## Usage

```typescript
import { z } from 'zod';

export const OrgParams = z.object({ orgId: z.string() });

export const Routes = {
  home: makeRoute(({ orgId }) => `/org/${orgId}`, OrgParams),
};
```

```typescript
import Link from 'next/link'
import {Routes} from '../../routes.ts'

<Link href={Routes.home({orgId: 'someId'})} />
```

## Developing

- `npm run watch:build`
- To test: `npm run test`