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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ipgeotrace/svelte

v0.1.0

Published

Svelte bindings for IPGeoTrace. Resolve the visitor's location once and read it from a reactive store.

Readme

@ipgeotrace/svelte

Svelte bindings for IPGeoTrace. Resolve the visitor's location once and read it from a reactive store. Built on @ipgeotrace/browser — it uses a publishable key, so it's safe in the client.

Sign up and grab your publishable key at ipgeotrace.com.

Install

npm add @ipgeotrace/svelte svelte

Usage

createVisitorGeo() returns a store that calls me() once on creation. Read it with the $ prefix:

<script lang="ts">
  import { createVisitorGeo } from '@ipgeotrace/svelte';

  const geo = createVisitorGeo({ publishableKey: 'pk_live_...' });
  $: currency = $geo.data?.country?.currency ?? 'USD';
</script>

{#if $geo.loading}
  <p>Locating…</p>
{:else if $geo.error}
  <p>Couldn't detect your location.</p>
{:else}
  <p>Prices in {currency}</p>
{/if}

Sharing one lookup across components

Create the store once high in the tree, put it in context, and read it anywhere below — a single me() call shared everywhere:

<!-- +layout.svelte -->
<script lang="ts">
  import { setVisitorGeo } from '@ipgeotrace/svelte';
  setVisitorGeo({ publishableKey: 'pk_live_...' });
</script>

<slot />
<!-- any child component -->
<script lang="ts">
  import { useVisitorGeo } from '@ipgeotrace/svelte';
  const geo = useVisitorGeo();
</script>

<span>{$geo.data?.city?.name ?? '—'}</span>

What the store holds

Each value is { data, error, loading }, and the store also exposes refresh():

  • data — the GeoResponse, or undefined until it resolves.
  • error — a GeoError if the lookup failed (rate_limited, network_error, …).
  • loadingtrue while the request is in flight.
  • refresh() — run me() again. Useful after you know the network changed (e.g. the user toggled a VPN), since the result is never cached — every call reflects the visitor's location right now.

Options

Defer the first call, pass browser-client options, or bring your own client:

createVisitorGeo({ publishableKey: 'pk_live_...', immediate: false });
createVisitorGeo({ publishableKey: 'pk_live_...', options: { timeoutMs: 3_000 } });

import { createBrowserClient } from '@ipgeotrace/browser';
const client = createBrowserClient({ publishableKey: 'pk_live_...' });
createVisitorGeo({ client });

See the @ipgeotrace/browser README for the underlying me() client and publishable keys.