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

ynpx

v3.0.4

Published

`npx` equivalent in yarn, with multi-package-manager support (pnpm, yarn, npm)

Readme

.github/workflows/test.yml

ynpx

npx equivalent in yarn with multi-package-manager support (pnpm, yarn, npm)

此模組名稱為 ynpx 而非 ypx。YNPX 是 npx 的 Yarn 等價實現,支援多種套件管理器。 This module name is ynpx not ypx. YNPX is an npx equivalent in yarn with multi-package-manager support.


Features

  • v3+ Auto-Detection: From v3, automatically detect and use pnpm, yarn, or npm / 從 v3 開始,自動偵測並使用 pnpm、yarn 或 npm
  • Multi-Package-Manager Support: Auto-detect and use pnpm, yarn, or npm / 自動偵測並使用 pnpm、yarn 或 npm
  • Fast Execution: Cache packages for faster subsequent runs / 快取套件以加速後續執行
  • Temporary Environment: Isolated temp directory for each execution / 每次執行時建立隔離的臨時目錄
  • Flexible Configuration: Support for .yarnrc, .npmrc, and custom configs / 支援 .yarnrc、.npmrc 和自訂配置
  • Debug Mode: Keep temp directories after execution for debugging / 調試模式:執行後保留臨時目錄以便除錯

First run (when not have cache), need a long wait

image

Second run only need 5.x sec

image_1

Install

# 使用 npm 安裝 / Install with npm
npm install -g ynpx

# 使用 yarn 安裝 / Install with yarn
yarn global add ynpx

# 使用 pnpm 安裝 / Install with pnpm
pnpm add -g ynpx

Usage

Basic Usage

ynpx jest
ynpx -p esm -p mocha --prefer-offline -- "!(node_modules)/**/*.{test,spec}.{ts,tsx}"

Package Manager Selection

v3+ Feature: From v3, ynpx will auto-detect available package managers automatically.

By default, ynpx will auto-detect available package managers in the order: pnpmyarnnpm.

You can specify a preferred package manager:

# Use npm specifically
ynpx --npmClient npm jest

# Use pnpm specifically  
ynpx --pm pnpm jest

# Try yarn first, fallback to npm
ynpx --npmClient yarn --npmClient npm jest

Command Options

| Option | Alias | Description | 選項說明 | |--------|-------|-------------| | --package | -p | Specify packages to install | 指定要安裝的套件 | | --npmClient | --pm | Specify package manager (npm, yarn, pnpm) | 指定套件管理器 (npm, yarn, pnpm) | | --quiet | -q | Suppress output | 抑制輸出 | | --prefer-offline | | Use offline cache first | 優先使用離線快取 | | --ignore-existing | | Skip checking if packages exist | 跳過檢查套件是否存在 | | --no-install | | Skip package installation | 跳過套件安裝 | | --shamefully-hoist | | Flat node_modules (for pnpm) | 扁平化 node_modules (適用於 pnpm) | | --userconfig | --rc | Specify yarnrc config file | 指定 yarnrc 配置文件 | | --cwd | | Set working directory | 設定工作目錄 | 設定工作目錄 | | --debugMode | | Keep temp directories after execution for debugging | 執行後保留臨時目錄以便除錯 |

Examples

# Run mocha with TypeScript support
ynpx -p esm -p ts-node -p mocha -- -r esm

# Run in quiet mode
ynpx -q cowsay -- "ynpx"

# Use offline cache
ynpx --prefer-offline jest

ynpx -q cowsay -- "workflows test"

image_2

Aliases

After install you can use alias names:

ynpx mocha
yypx mocha
ypx mocha

Module Structure

The ynpx package consists of the following modules:

| Module | Description | |--------|-------------| | createTemporaryDirectory | Creates temp directories for package installation | | installDependencies | Handles package installation with multi-PM support | | findCommand | Locates package binaries | | handleEnv | Manages environment variables and PATH | | handleOptions | Processes CLI arguments | | initConfig | Generates configuration files | | initTemporaryPackage | Initializes temp package structure | | logger | Provides colored console output | | types | TypeScript type definitions | | util | Utility functions | | err | Custom error classes |

Related Tools

Links

  • https://github.com/yarnpkg/yarn/issues/3937
  • https://github.com/bluelovers/ws-ypx

License

ISC