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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-scrub

v1.1.1

Published

Walk a directory tree and remove files not necessary in a production node environment.

Downloads

33

Readme

node-scrub

Walk a directory tree and remove files not necessary in a production node environment.

WARNING: this program walks a directory tree and deletes files. Double check what you are doing before executing. The program's --dry-run option is true by default. It is highly advisable to use it in dry-run mode first.

Installation

npm install -g node-scrub

Usage

Typical usage is to run it with the target node_modules directory as the argument.

Executing in the node-scrub project root, will be something like:

$ node-scrub node_modules
------summary------
 (dry-run results)
total bytes: 65818 directories: 6 files: 26
deleted bytes: 35412 directories: 0 files: 20
percents: bytes 53.8 directories 0.0 files 76.9
elapsed time 11ms

Note that the option --dry-run is by default true and that's a good thing because if I accidentally executed it as follows it would delete files that I probably didn't want to delete.

$ node-scrub .
------summary------
 (dry-run results)
total bytes: 329447 directories: 54 files: 89
deleted bytes: 37157 directories: 0 files: 22
percents: bytes 11.3 directories 0.0 files 24.7
elapsed time 22ms

Command-line options

The first argument is the root of the directory tree to walk, looking for files and directories to delete.

  • --dry-run - [true], use --dry-run false to delete files and directories.
  • --details, -d - [false], show count and size for each match deleted.
  • --verbose - [false], print every directory and file deleted.
  • --very-verbose - [false], print every directory, file, and link traversed + verbose.

todos

  • add command-line exclusions, for now you have to fiddle with defaults.js
  • allow detailed listing of deletion filepaths by pattern-matched
  • write tests (only manual tested at this point)