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

alfred-workflow-switch

v0.2.1

Published

Safely switch one Alfred workflow slot between an installed release and local source

Readme

alfred-workflow-switch

Safely switch one Alfred workflow slot between an installed release and local source. The installed release is preserved while development source is active, so Alfred shows only one workflow.

Install

npm install --save-dev alfred-workflow-switch

Add the production and development bundle IDs to the workflow's package.json:

{
  "alfredWorkflowSwitch": {
    "releaseBundleId": "com.example.alfred-workflow",
    "developmentBundleId": "com.example.alfred-workflow.dev"
  },
  "scripts": {
    "dev": "alfred-workflow-switch dev",
    "prod": "alfred-workflow-switch prod",
    "mode": "alfred-workflow-switch status",
    "doctor": "alfred-workflow-switch doctor"
  }
}

developmentBundleId is optional and defaults to releaseBundleId. Set workflowPath when info.plist is not in the package root.

Commands

npm run dev      # preserve the installed release and link local source
npm run prod     # remove the matching development link and restore the release
npm run mode     # print the current mode
npm run doctor   # print paths, bundle IDs, lock status, and recovery details

Append -- --json to mode or doctor for machine-readable output.

The first dev command requires an installed release whose info.plist contains the configured releaseBundleId. The tool discovers its real Alfred workflow slot instead of deriving a destination from the npm package name.

Help and Version

alfred-workflow-switch --help     # show usage
alfred-workflow-switch --version  # show package version

Short forms -h and -v are also supported.

Safety model

  • Release backups live under <Alfred Preferences>/.workflow-switch/, normally on the same filesystem as the workflow slot.
  • Moves use rename and failed link or restore operations are rolled back.
  • Only a symbolic link resolving to the configured local source can be removed.
  • Foreign links, duplicate release bundle IDs, invalid destinations, and backup conflicts are never overwritten automatically.
  • A per-workflow lock prevents concurrent switch operations.
  • Interrupted operations remain recoverable with either dev or prod.

Recovery

Interrupted Operations

If a switch operation is interrupted (for example, the workflow slot symlink is deleted or becomes dangling), the tool can recover:

  • dev command: Recreates the development symlink when the slot is missing or dangling and a backup exists.
  • prod command: Restores the release backup when the slot is missing or dangling.
  • doctor command: Shows the current state and suggests recovery steps.

Conflict State

When both an installed release and a backup exist at the same time, the tool refuses to overwrite either automatically. The doctor command shows both paths and explains how to recover manually:

  1. Inspect both directories to determine which one to keep
  2. Remove the one you don't want
  3. Run dev or prod to re-establish the switch

Workflow Discovery Errors

The tool now reports plist parse errors and other discovery failures instead of silently skipping workflows. If you see a discovery error:

  • Check that your workflow's info.plist is valid XML
  • Verify file permissions on the workflow directory
  • Run doctor for detailed diagnostics

This package does not build, publish, install, or refresh Alfred workflows. It only manages the development/production switch.