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 🙏

© 2025 – Pkg Stats / Ryan Hefner

country-linkify

v24.484.11725

Published

Simple service to redirect links based on the client's country.

Downloads

46

Readme

Country Linkify

Simple Node.js library / service to redirect links based on the client's country and link ID.

Link definitions

All links should be defined in .json files under the /links folder (or another folder, if you change the settings.links.path key). Each file represents a source, for example, a specific website or category of links.

Each key inside the JSON specs represents a link ID, and the target URLs by country. If a key gets a single string as its value, this will be the URL valid for any country.

There are also 2 standard keys, prefixed with an underscore:

  • _default: the default target URL(s) for that source.
  • _search: URL for the search page of the source, must have a {{query}} tag defined

A sample definition for "Amazon":

{
    "_default": {
        "de": "https://www.amazon.de/",
        "us": "https://www.amazon.com/",
        "uk": "https://www.amazon.co.uk/"
    },
    "_search": {
        "us": "https://www.amazon.com/s?k={{query}}"
    },
    "deals": {
        "de": "https://www.amazon.de/-/en/deals",
        "us": "https://www.amazon.com/gp/goldbox",
        "uk": "https://www.amazon.co.uk/gp/deals"
    },
    "help": "https://www.amazon.com/gp/help/customer/display.html"
}

And a second file for "AliExpress":

{
    "_default": "https://aliexpress.com",
    "_search": {
        "de": "https://de.aliexpress.com/w/{{query}}.html"
    },
    "deals": {
        "de": "https://www.aliexpress.com/sp/campaign/wow/gcp-plus/300000444/njcQZ4CkBb"
    }
}

With the samples above, a user from Germany (de) will get redirected to the following target URLs:

  • /l/amazon: https://www.amazon.de/
  • /l/amazon-help: https://www.amazon.com/gp/help/customer/display.html
  • /l/amazon-deals: https://www.amazon.de/-/en/deals
  • /l/deals: https://www.amazon.de/-/en/deals or https://www.aliexpress.com/sp/campaign/wow/gcp-plus/300000444/njcQZ4CkBb
  • /s/some-item: https://de.aliexpress.com/w/some-item.html

And the results for someone from US:

  • /l/amazon: https://www.amazon.com/
  • /l/amazon-help: https://www.amazon.com/gp/help/customer/display.html
  • /l/amazon-deals: https://www.amazon.com/gp/goldbox
  • /s/some-item: "https://www.amazon.com/s?k=some+item"

Settings

This tool is using the SetMeUp module to handle its settings, so for detailed info please check its docs.

  • settings.json - settings shared by all environments, targeting production by default
  • settings.development.json - development settings, mostly when running on your dev machine
  • settings.production.json - production-only settings, except credentials and secrets (optional)
  • settings.local.json - private local-only settings, excluded from the GIT repo

Settings are self explanatory, please open each file to check the available options.