Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Generates a Route Manifest for you. It allows you to refer to a page by name instead of location
Delir
generates a Route Manifest for you. It allows you to refer to a
page by name instead of location:
npm install -g delir
delir ./your-output-file
delir ./your-output-file --workspace ./your-next-app-folder
// Assume you have a page at app/pages/products/[productId].tsx
export default function ProductsPage() { ...
// You can then use Routes...
import { Link } from "next"
import { Routes } from "../path-to-manifest-file"
// ...to refer to it by name...
<Link href={Routes.ProductsPage({ productId: 123 })} />
// ...instead of looking up the location!
<Link href={`/products/${123}`} />
The Route Manifest has some advantages:
Query parameters can be specified together with route parameters.
// instead of ...
<Link href={`/products/${pid}?offerCode=capybara`} />
// ... you can do:
<Link href={Routes.Product({ pid, offerCode: "capybara" })} />
Simple cli which is an extract of the routes manifest feature from blitz. Thanks for the super framework ❤️
// Assume you have a page at app/pages/products/[productId].tsx
export default function ProductsPage() { ... }
import { useRouter } from 'next/router';
// You can then use Routes...
import { Routes } from "../path-to-manifest-file";
// in your server api
Routes.ProductsPage.isActive(someobject.path)
// generically without next router
Routes.ProductsPage.isActive(window.location.pathname)
// with asPath from useRouter
const { asPath } = useRouter();
Routes.ProductsPage.isActive(asPath);
FAQs
Generates a Route Manifest for you. It allows you to refer to a page by name instead of location
The npm package delir receives a total of 1 weekly downloads. As such, delir popularity was classified as not popular.
We found that delir demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.