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

as-soon

v0.1.6

Published

watch and execute

Readme

as-soon

A lightweight file watcher that executes commands as soon as files change.

What is as-soon?

as-soon is a command-line tool that watches specified files or directories and automatically executes a command whenever changes are detected. It's perfect for development workflows where you need to rebuild, test, or restart processes whenever your code changes.

Features

  • Simple and fast - Watch files and execute commands with minimal configuration
  • Flexible watching - Watch specific directories or the current working directory
  • Debounced execution - Commands are debounced (200ms) to avoid excessive runs during rapid file changes
  • File creation support - Can watch for files that don't exist yet and automatically start watching them once created
  • Environment variables - Loads environment variables from .env files automatically
  • Directory recreation handling - Automatically re-subscribes when watched directories are deleted and recreated

Installation

npm install -g as-soon
# or
pnpm add -g as-soon

Or use it locally in your project:

npm install -D as-soon
# or
pnpm add -D as-soon

Usage

Basic Usage

Watch the current directory and execute a command on any file change:

as-soon command

Watch Specific Directories

Use the -w flag to watch specific directories:

as-soon -w src -w public pnpm build

Watch Specific Files

You can also watch specific files:

as-soon -w package.json -w tsconfig.json pnpm build

Pass Arguments to Commands

Any arguments after the command are passed through:

as-soon pnpm test -- --watch

Multiple Watch Paths

Watch multiple directories:

as-soon -w src -w test pnpm build

How It Works

  1. Initial Execution: The command runs immediately when you start as-soon
  2. File Watching: It watches the specified directories (or current directory by default)
  3. Change Detection: When files are added, modified, or deleted, it detects the changes
  4. Debounced Execution: After a 200ms debounce period, the command executes again
  5. Continuous Watching: The process continues until you stop it (Ctrl+C)

Examples

Development Workflow

Watch your source files and rebuild on changes:

as-soon -w src pnpm build

Test Runner

Run tests whenever test files change:

as-soon -w test pnpm test

Type Checking

Run TypeScript type checking on file changes:

as-soon -w src tsc --noEmit

Multiple Workspaces

Watch multiple directories in a monorepo:

as-soon -w packages/app/src -w packages/lib/src pnpm build

Watch Non-Existent Files

You can even watch for files that don't exist yet:

as-soon -w ./config/dev.ts pnpm build

This is useful for configuration files that might be created later.

Command-Line Options

  • -w <path> - Specify a directory or file to watch (can be used multiple times)
  • All other arguments are treated as the command to execute

Environment Variables

as-soon automatically loads environment variables from .env files using ldenv.

License

MIT