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

supergoto

v0.5.0

Published

<p align="center"> <img src="https://raw.githubusercontent.com/harshmandan/supergoto/main/logo.svg"></img> </p>

Downloads

3

Readme

Supergoto

Extension of svelte's goto module with additional navigation options and URL Search parameters management.

What it does

Supergoto builds upon Svelte's inbuilt goto module to better handle the navigation actions. Since it's built on top of the existing module and uses the same options and API you do not have to un-learn anything. It adds functionality on top of the existing API to handle URL search and has parameters and adds safe ways to manipulate those parameters along with some other additional features!

Features

  • Navigate while keeping your URL parameters intact
  • Update search parameters without navigation
  • Update hash parameters without navigation
  • Easily manage the redirect option
  • Prevent external navigation by default
  • Prevent XSS attacks by preventing navigating to javascript: and script: URLs.

Upcoming Features:

  • [ ] Simplify API by merging hash and search params options
  • [ ] Use JSON.parse() & JSON.stringify() to support serializing/deserializing value types other than string
  • [ ] Interactive demo
  • [ ] Add JSDocs reference to all definitions
  • [ ] Make this library framework agnostic

API

Since supergoto uses goto under the hood the existing options remain the same, but now you have other useful functions as well


function supergoto(
  url: string | URL,
  options?: {
    /**
     * If `true`, will replace the current `history` entry rather than creating a new one with `pushState`
    */
    replaceState?: boolean;
    /**
     * If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation
    */
    noScroll?: boolean;
    /**
     * If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body
    */
    keepFocus?: boolean;
    /**
     * The state of the new/updated history entry
    */
    state?: any;
    /**
     * If `true`, all `load` functions of the page will be rerun. See https://kit.svelte.dev/docs/load#rerunning-load-functions for more info on invalidation.
    */
    invalidateAll?: boolean;
    /**
    * If `true`, navigation will be allowed to external host URLs. Otherwise navigation to other host/origin URLs will be blocked
    */
    external?: boolean;
    /**
     * If `true`, the current URL will be added as a search param with the key `redirectTo` which can be retrieved after navigation
    */
    preserveUrlForRedirection?: boolean;
    /**
     * Supplied object will be serialized and stored as hash parameter. See https://developer.mozilla.org/en-US/docs/Web/API/URL/hash
    */
    hashParams?: object;
    /**
     * If `true`, the current hash parameters will be preserved and will remain after navigation. Otherwise, hash parameters will get cleared
    */
    preserveHashParams?: boolean;
    /**
     * Supplied record/map will be serialized and stored as url search parameter. See https://developer.mozilla.org/en-US/docs/Web/API/URL/search
    */
    searchParams?: SearchParams;
     /**
     * If `true`, the current search parameters will be preserved and will remain after navigation. Otherwise, search parameters will get cleared
    */
    preserveSearchParams?: boolean;
  }
)

DEMO

Coming Soon