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

@ffz/link-service

v5.3.2

Published

A service that visits links and returns well structured, consumable metadata for clients to use for building rich embeds and tool-tips.

Downloads

72

Readme

@ffz/link-service

NPM Version

Link resolver service for FrankerFaceZ.

  • Supports site-specific modules for refining responses
  • Falls back to <meta> tags and HTML scraping if necessary
  • Keeps track of page redirects
  • Support for safety checking individual URLs, including via Google SafeBrowsing if configured.
  • Support for caching, integrated with redirect handling

Use as a Dependency

$ npm install @ffz/link-service --save
import LinkService from '@ffz/link-service';

const service = new LinkService(config);

const embed = await service.resolve(url);

Getting Started Developing

This project uses the pnpm package manager. To get everything you need:

  1. Install node.js and pnpm
  2. Run pnpm install within the project's directory.

From there, you can use pnpm to build the service from source by running pnpm build, build documentation with pnpm docs, and start the development tool.

The built-in development tool both provides an interactive shell and that runs an HTTPS server the client can communicate with for testing. To start it, just run:

$ pnpm start

By default, this will start the HTTPS server listening on port 8002 with a self-signed certificate. In order to use this server for developing with FrankerFaceZ, you'll need to ensure your browser will accept self-signed certificates for localhost. That may involve visiting https://localhost:8002 in your browser and making an exception for the certificate.

Once you've done that, you can use either the FrankerFaceZ client itself or our documentation's Testing Tool to start making requests to the local server.

When using the FrankerFaceZ client, you'll need to open the control center to Debugging > Data Sources and change the Link Resolver to Local Dev Server.

When using the documentation Testing Tool, just change the Provider to Local Dev Server.

At that point, you just pick a URL for testing or enter a custom URL and you go to work implementing your custom resolver.

Configuration

If you create a file named config.json, that file will be used to configure the LinkService instance from the shell script. You should use this file to install API keys for local testing, if necessary.

Remaining Tasks

  • Add more services
  • Finish Documentation
  • Write Tests

Documentation

Tests

Run tests using pnpm test.

Contributions and Support

Please submit all issues and pull requests to the FrankerFaceZ/link-service repository.