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

@jgarber/eleventy-plugin-webfinger

v0.2.0

Published

An Eleventy plugin for generating a Webfinger configuration file.

Readme

eleventy-plugin-webfinger

An Eleventy plugin for generating a Webfinger configuration file.

npm Downloads

Usage

First, add the plugin as a development dependency to your project's package.json file:

npm install --save-dev @jgarber/eleventy-plugin-webfinger

Next, add the plugin to your project's Eleventy configuration file (e.g. eleventy.config.js):

import eleventyPluginWebfinger from "@jgarber/eleventy-plugin-webfinger";

export default async function(eleventyConfig) {
  eleventyConfig.addPlugin(eleventyPluginWebfinger);
}

With no additional configuration, eleventy-plugin-webfinger will use a global data object named webfinger to populate a template at the permalink /.well-known/webfinger.

// Using a global data file at `_data/webfinger.js`
const subject = "acct:[email protected]";

const aliases = ["https://jgarber.example"];

const links = [
  {
    href: "https://jgarber.example/avatar.png",
    rel: "http://webfinger.net/rel/avatar",
    type: "image/png",
  },
  {
    href: "https://jgarber.example/about",
    rel: "http://webfinger.net/rel/profile-page",
    type: "text/html",
  },
  {
    href: "https://jgarber.example/users/jgarber",
    rel: "self",
    type: "application/activity+json",
  },
];

export default { subject, aliases, links };

If a global data file (or other data file) doesn't suit your needs, you may directly provide configuration to the plugin:

import eleventyPluginWebfinger from "@jgarber/eleventy-plugin-webfinger";

export default async function(eleventyConfig) {
  eleventyConfig.addPlugin(eleventyPluginWebfinger, {
    subject: "acct:[email protected]",
    aliases: ["https://jgarber.example"],
    links: [
      {
        href: "https://jgarber.example/avatar.png",
        rel: "http://webfinger.net/rel/avatar",
        type: "image/png",
      },
      {
        href: "https://jgarber.example/about",
        rel: "http://webfinger.net/rel/profile-page",
        type: "text/html",
      },
      {
        href: "https://jgarber.example/users/jgarber",
        rel: "self",
        type: "application/activity+json",
      },
    ],
  });
}

The examples above are fairly rudimentary and not that much different from creating a template in your project's source directory. However, consider the example below which reuses data from a different global data file:

// _data/actor.json
const url = new URL("https://jgarber.example");
const id = new URL("users/jgarber", url);

const icon = {
  mediaType: "image/png",
  type: "Image",
  url: new URL("avatar.png", url),
};

const preferredUsername = "me";

export default { url, id, icon, preferredUsername };
// _data/webfinger.js
import actor from "./actor.js";

const { url, id, icon, preferredUsername } = actor;

export default {
  subject: `${preferredUsername}@${url.hostname}`,
  aliases: [url, id],
  links: [
    {
      href: icon.url,
      rel: "http://webfinger.net/rel/avatar",
      type: icon.mediaType,
    },
    {
      href: new URL("about", url),
      rel: "http://webfinger.net/rel/profile-page",
      type: "text/html",
    },
    {
      href: id,
      rel: "self",
      type: "application/activity+json",
    },
  ],
};

Deployment Considerations

The file generated by this plugin, .well-known/webfinger, doesn't have a file extension and should be served with a content type of application/jrd+json. Consult RFC 7033 for details.

You should configure the following HTTP response headers using your hosting provider's configuration. The following configuration is suitable for a _headers file deployed to Cloudflare Pages:

/.well-known/webfinger
  Access-Control-Allow-Origin: *
  Content-Type: application/jrd+json; charset=UTF-8

Limitations

The ./well-known/webfinger configuration produced by this plugin is a static file and, as such, will not respond differently to queries defined by the Webfinger specification (see section 4.1). This plugin is well-suited for personal websites that represent a single "resource" (e.g. a person [you!], a group [your band!], an organization [your crew!]).

Your hosting provider may support query parameters in _redirects files, so perhaps there's a way to dynamically generate files using this plugin. Give it a try!

Acknowledgments

First and foremost, eleventy-plugin-webfinger wouldn't be possible without Zach Leatherman's incredible work creating Eleventy and his stewardship of its community.

eleventy-plugin-webfinger is written and maintained by Jason Garber.