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

@yourfam/yf-empty

v0.2.0

Published

Empty file contents and leave the files in place

Readme

yf-empty

Empty file contents and leave the files in place.

Pass a folder to blank every file directly in it, or a folder and file names to blank only those. Tracked files and gitignored files are both fine. The tool does not commit. Node 20+.

  • Source / README: https://github.com/YourFam/yf-empty
  • npm: https://www.npmjs.com/package/@yourfam/yf-empty
  • Unscoped alias: https://www.npmjs.com/package/yf-git-empty
  • Issues: https://github.com/YourFam/yf-empty/issues

Install

npm install -g @yourfam/yf-empty

Then from any directory:

yf-empty path/to/folder

The command is yf-empty. No install:

npx @yourfam/yf-empty path/to/folder
npx yf-git-empty path/to/folder

npx yf-git-empty is the unscoped alias of @yourfam/yf-empty (same CLI, same version). npm may reject unscoped yf-empty as too similar to an existing package. After -g, the command is yf-empty.

| | npm install -g @yourfam/yf-empty | npm install -D @yourfam/yf-empty | |---|---|---| | Where it goes | Global npm prefix | node_modules/ of the current repo | | Command | yf-empty from any folder | npx yf-empty in that repo | | Typical use | A CLI you want everywhere | A tool this repo runs in scripts |

With -D, plain yf-empty is not on your PATH. Use npx yf-empty.

Usage

yf-empty <folder> [file...]
yf-empty --y <folder> [file...]
yf-empty --this-folder
yf-empty notes
yf-empty notes a.txt b.txt
yf-empty notes draft/a.txt
yf-empty --this-folder
yf-empty --y notes

The command warns before it changes anything:

Destructive: this will empty the files in notes.
Press Y to continue:

With file names, the warning names those files. Type Y and press Enter. Any other answer leaves every file as it is.

--y skips that prompt. You already approved the empty, so the command runs. A script or a non-interactive shell has no prompt to answer: pass --y, or the command refuses and changes nothing.

A folder alone empties every file sitting directly in that folder. Files in subfolders stay as they are. Dotfiles in that folder are included.

File names are relative to the folder. Only those files are emptied. ../secret.txt is refused. A missing name fails the command before any file is changed.

Symlinks are refused, so a shortcut is not followed into another file. Directories are not removed. Git is not read and not changed. If the empty files should be recorded, commit them yourself.

--this-folder empties the files in the directory where you run the command. It does not take a folder name. yf-empty with no arguments prints an error instead of blanking the current directory.

Each emptied file is printed to stderr as emptied a.txt. An empty folder prints emptied 0 files.

Development

git clone https://github.com/YourFam/yf-empty.git
cd yf-empty
npm test
node ./bin/yf-empty.js --help

Maintainer: YourFam (kamal-yourfam on npm). MIT.

Publish the unscoped alias (maintainers)

The GitHub repo publishes two npm packages at the same version:

  1. npm publish --access public from the repo root → @yourfam/yf-empty
  2. Then from alias/, with matching version and dependencies["@yourfam/yf-empty"]:
cd alias
npm publish --access public

That second package is named yf-git-empty and only shims the scoped CLI so npx yf-git-empty cannot be squatted.

License

MIT © 2026 YourFam. See LICENSE.