Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@breezehr/next-static-paths

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@breezehr/next-static-paths

Static types for routing in Next.js apps

  • 0.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

next-static-paths

Statically prevent HTTP 404 Not Found in your Next.js applications using TypeScript and code generation.

Usage

$ pnpm add next-static-paths
# or
$ yarn add next-static-paths
# or
$ npm install next-static-paths

Then, from within your Next.js application root, run the following command:

# For pnpm users
$ pnpx next-static-paths

# For yarn users
$ yarn next-static-paths

# For npm users
$ npx next-static-paths

It's recommended to configure scripts in your package.json too

{
  "dev": "next-static-paths --pages-dir ./src --output . && next dev",
  "generate-routes": "next-static-paths --pages-dir ./src --output . && :"
}
import { TypedLink } from "@breezehr/next-static-paths";
function MyComponent() {
  return (
    <TypedLink as="/some/[myArgument]" myArgument="hello world">
      Hello world
    </TypedLink>
  );
}

pathFor helper

import { pathFor } from "@breezehr/next-static-paths";

function getPath() {
  return pathFor("/some/[myArgument]", { myArgument: "hello world" });
}

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc