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

@openscan/hardhat-plugin

v0.0.7

Published

Hardhat 3 plugin to display OpenScan links

Downloads

61

Readme

openscan-hardhat-links

A Hardhat plugin that automatically launches the OpenScan Explorer webapp and adds OpenScan links to all transaction logs.

Installation

To install this plugin, run the following command:

npm install --save-dev openscan-hardhat-links

In your hardhat.config.ts file, import the plugin and add it to the plugins array:

import { defineConfig } from "hardhat/config";
import openScanPlugin from "openscan-hardhat-links";

export default defineConfig({
  plugins: [openScanPlugin],
  networks: {
    ...
  },
  openScan: {
    url: "http://localhost:3030",
    chainId: 31337,
  },
});

Features

This plugin provides two main features:

  1. Automatic OpenScan Explorer Launch: When you start the Hardhat node, the plugin automatically:

    • Launches a local OpenScan Explorer webapp on port 3030
    • Opens your default browser to http://localhost:3030
    • Serves the explorer from the plugin's built-in webapp
  2. OpenScan Links in Logs: All transaction-related logs include clickable OpenScan links:

    • Transaction hashes → OpenScan transaction view
    • Addresses → OpenScan address view
    • Blocks → OpenScan block view
    • Contract deployments → OpenScan contract view

Usage

Simply start your Hardhat node:

npx hardhat node

The OpenScan Explorer will automatically launch and your browser will open to the explorer interface. All subsequent transactions will include OpenScan links in the console output

How It Works

Webapp Launch

The plugin hooks into Hardhat's network lifecycle using the newConnection hook. When the Hardhat node starts:

  1. The hook detects the first network connection
  2. Checks if port 3030 is available (fails fast if not)
  3. Starts a custom HTTP server serving static files from the built-in explorer webapp
  4. Opens your default browser to the explorer URL
  5. Logs a success message with a clickable link

The webapp continues running as long as the Hardhat node is active and automatically cleans up when the node stops.

Transaction Logging

The plugin uses the onRequest network hook to intercept all JSON-RPC requests. For relevant methods (like eth_sendTransaction, eth_getTransactionReceipt, etc.), it extracts transaction hashes, addresses, and block numbers, then outputs clickable OpenScan links to the console.

Requirements

  • Hardhat 3.x
  • Node.js 24+
  • Port 3030 must be available

Troubleshooting

Port 8545 or 3030 Already in Use

If you see an error about port 8545 or 3030 being in use, you need to free up that port:

kill -9 $(lsof -t -i:8545)
kill -9 $(lsof -t -i:3030)