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

jdm-plugin-template

v1.0.0

Published

A starter template for building jdm-cli plugins

Readme

jdm-plugin-template

A starter template for building jdm-cli plugins. This repo is also self-bootstrapping — the create command clones this very repo into a new project, giving contributors a clean slate to start from.


What is this?

jdm-plugin-template is the official base template for all jdm-cli plugins. It ships with a working plugin structure, a set of standard commands (create, dev, build, clean, install), shared logging helpers, and a version compatibility system — so you spend time building your plugin, not scaffolding it.


Quick Start

Use this template to scaffold a new plugin

# Install the CLI (if you haven't already)
npm install -g jdm-cli
jdm-cli add plugin-template

# Scaffold a new plugin project
jdm-cli plugin-template create

# Then follow the prompts, or use flags:
jdm-cli plugin-template create --name my-plugin
jdm-cli plugin-template create --name my-plugin --install

This will:

  1. Clone this repo into a folder named my-plugin (or . for current dir)
  2. Strip .git so it's a clean project — not a fork
  3. Optionally run npm install for you

Project Structure

jdm-plugin-template/
├── lib/
│   ├── index.js          # Entry point — namespace, command map, dispatcher
│   ├── config.js         # Config read/write and compatibility guard
│   ├── compat.js         # Plugin version + per-command compatibility ranges
│   ├── logger.js         # Shared logging helpers (ok, fail, warn, info, step, header)
│   └── commands/
│       ├── create.js     # Scaffold a new project (clones this repo)
│       ├── dev.js        # Start development environment
│       ├── build.js      # Compile / package the project
│       ├── clean.js      # Remove build artifacts
│       └── install.js    # Install dependencies
├── package.json
└── README.md

Built-in Commands

| Command | Description | Key Flags | |-----------|------------------------------------------|----------------------------------------| | create | Scaffold a new project from this template | --name <name>, --install | | dev | Start development environment | (wire up your own processes) | | build | Compile / package the project | --frontend, --backend, --full | | clean | Remove build artifacts | --dry (preview without deleting) | | install | Install dependencies | (none) |


Contributing / Building Your Own Plugin

This repo is the starting point. Here's how to get going:

1. Scaffold a copy

jdm-cli plugin-template create --name my-plugin --install
cd my-plugin

Or clone manually:

git clone https://github.com/JDM-Github/jdm-plugin-template my-plugin
cd my-plugin
rm -rf .git
npm install

2. Set your namespace

In three places, replace "plugin-template" with your plugin's name:

| File | What to change | |---|---| | lib/index.js | export const namespace = "plugin-template" | | lib/config.js | const PLUGIN_NAME = "plugin-template" | | lib/logger.js | const ns = "plugin-template" inside header() | | package.json | "name", "jdmPlugin.namespace", "jdmPlugin.description" |

3. Add your commands

  1. Create lib/commands/my-command.js with a default export
  2. Import it in lib/index.js and add it to the commands map
  3. If it needs interactive prompts (ask(rl, ...)), add the name to INTERACTIVE_COMMANDS
  4. Add it to showDesign() for the help screen
  5. Add it to the jdmPlugin.commands array in package.json

4. Wire up dev and build

Both files have clearly marked // TODO blocks — drop in your actual build commands, server launchers, or watchers there. Cross-platform terminal helpers (Windows Terminal, CMD, gnome-terminal, osascript) are already included in dev.js.

5. Update compatibility (when needed)

When you make breaking changes to the template structure, bump COMPAT in lib/compat.js so existing projects get a clear error instead of a silent failure:

// lib/compat.js
export const pluginVersion = "1.1.0";

export const COMPAT = {
    global: ">=1.1.0",  // bump when ALL commands need a newer project
    commands: {
        build: ">=1.1.0",  // or target a specific command
    },
};

Logger Helpers

All commands share the same logging helpers from lib/logger.js:

import { ok, fail, warn, info, step, header, divider } from "../logger.js";

ok(chalk, "Thing worked");        //  ✔  Thing worked  (green)
fail(chalk, "Thing broke");       //  ✖  Thing broke   (red)
warn(chalk, "Watch out");         //  ⚠  Watch out     (yellow)
info(chalk, "Just so you know");  //  ·  Just so you know (gray)

step(chalk, 1, 3, "Doing X");     // [1/3]  Doing X
header(chalk, "my-command");      // jdm / plugin-template / my-command
divider(chalk);                   // ─────────────────────────────────────

Config System

Every scaffolded project gets a .jdm-config.json file. This allows commands to verify they're running inside a compatible project:

{
  "plugin-template": {
    "pluginVersion": "1.0.0",
    "createdAt": "2025-01-01T00:00:00.000Z",
    "projectName": "my-plugin"
  }
}

Use checkCompat(chalk, "command-name") at the top of any command that requires a valid project context. It will warn if the config is missing, or error with a helpful message if the version is out of range.


Requirements

  • Node.js 18+
  • Git (for the create command)
  • jdm-cli installed globally

License

MIT — JDM-Github