npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

next-flexible-routes

v0.2.3

Published

Next Flexible Routes is a library to takle the pain of routing in a next.js app.

Downloads

7

Readme

Next Flexible Routes Build Status Coverage Status npm version

Next Flexible Routes is a library to takle the pain of routing in a next.js app.

We have been using alternative libraries internally at CreditSCRIPT for a while and we have fund them very easy to start with but very hard to scale.

The reason is routing maps tend to change over time and it gets progressively hard to refactor without a strictly typed environment.

We decided to takle the pain and build a library for our own usage and we ended up deciding to open-source it thinking the community could benefit from it.

Features

  • Strongly typed link generation
  • Strongly typed parameters and query extraction
  • Minimal API to define routes
  • Maximum Flexibility on deployment
  • Custom (pluggable) codec to encode parameters (Date/UUID/etc)
  • Hash anchor management

Usage

Examples can be found in the with-next-flexible-routes package

Showcase

Showcase

Documentation

Please refer to api-docs and middleware-docs

Installation

yarn add next-flexible-routes

you will need additional peer dependencies to be installed:

"express": "^4.16.4",
"fp-ts": "^1.15.0",
"fp-ts-contrib": "^0.0.2",
"io-ts": "^1.8.4",
"lodash": "^4.17.11",
"next": "^8.0.3",
"path-to-regexp": "^3.0.0",
"query-string": "^6.4.2",
"react": "^16.8.5",
"react-dom": "^16.8.5"

quickly:

yarn add express fp-ts fp-ts-contrib io-ts lodash next path-to-regexp query-string react react-dom

Contributing

Pull requests are welcome. Please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Thanks

Huge thanks goes to the authors of fp-ts, io-ts, fp-ts-contrib, next.js, and any used library