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

npm-plugin-kit

v0.6.3

Published

A simple and powerful npm-based plugin system

Readme

npm-plugin-kit

A simple and powerful npm-based plugin system.

Installation

npm install npm-plugin-kit

Quick Start

import { createNpmPlugin } from 'npm-plugin-kit'

interface MyPlugin {
  doSomething: () => void
}

const pluginSystem = createNpmPlugin<MyPlugin>('plugin-id')

await pluginSystem.install('@my-app/plugin')
// Plugins are installed to ~/.plugin-id by default
const plugin = await pluginSystem.load('@my-app/plugin')

plugin.doSomething()

Custom npm Path

For Electron applications or custom environments, specify a custom npm executable:

const pluginSystem = createNpmPlugin('plugin-id', {
  npmPath: '/path/to/npm'
})

Plugin List & Cache

list() returns installed plugins with packageInfo (from package.json) and plugin (install metadata) separated:

const plugins = await pluginSystem.list()

plugins[0].name // package name (cache key)
plugins[0].packageInfo.version
plugins[0].packageInfo.description
plugins[0].packageInfo.author
plugins[0].plugin.root // absolute install directory
plugins[0].plugin.isLocal // installed from local path

Custom Cache Fields

Extract extra fields from each plugin's package.json via cacheFields:

interface MyExtra {
  homepage: string
  repository: { type: string, url: string }
}

const pluginSystem = createNpmPlugin<MyPlugin, MyExtra>('my-app', {
  cacheFields: ['homepage', 'repository']
})

const plugins = await pluginSystem.list()
plugins[0].packageInfo.homepage
plugins[0].packageInfo.repository.url

cacheFields supports three forms:

| Value | Behavior | |-------|----------| | true | Read package.json[pluginSystemId] (e.g. package.json['my-app']) | | string | Dot-path field, e.g. 'repository.url' | | string[] | Multiple dot-path fields, e.g. ['homepage', 'repository'] |

author is always included in packageInfo without configuring cacheFields.

list() automatically fills missing packageInfo / plugin fields from installed package.json and filesystem.

Cache Files

In the plugin directory (default ~/.{id}):

.plugins.json — plugin list cache (v1 structure):

{
  "my-plugin": {
    "packageInfo": {
      "version": "1.0.0",
      "description": "...",
      "author": "Alice"
    },
    "plugin": {
      "root": "/Users/me/.my-app/node_modules/my-plugin",
      "isLocal": false
    }
  }
}

.npm-plugin-kit.json — kit metadata:

{
  "cacheVersion": 1
}

Older flat cache formats are automatically migrated to v1 on the next list() call.

API Reference

createNpmPlugin<TPlugin, TExtra>(id: string, options?: PluginOptions)

Creates a plugin system instance.

Parameters:

  • id - Unique identifier for your plugin system (e.g. 'plugin-id')
  • options.pluginDir - Custom plugin directory (default: ~/.{id})
  • options.registry - Custom npm registry URL
  • options.npmPath - Custom npm executable path (default: 'npm')
  • options.cacheFields - Extra package.json fields to cache in packageInfo section

Returns: PluginSystem<TPlugin, TExtra>

Plugin System Methods

| Method | Description | |--------|-------------| | install(name, version?) | Install a plugin package | | uninstall(name) | Remove a plugin package | | load<T>(name) | Load and return plugin module | | list() | List all installed plugins | | search(keyword) | Search npm registry for plugins | | view(name) | Look up an exact package name on the registry | | update(name, version?) | Update plugin to new version | | resolve(name, ...paths) | Resolve path under plugin install directory |