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

timemachine-exclude

v1.0.1

Published

A CLI tool to manage Time Machine exclusions

Readme

timemachine-exclude

A CLI tool to manage Time Machine exclusions for node_modules and other specified directories. This tool helps you prevent backing up unnecessary large directories, improving the efficiency of Time Machine backups.

Installation

npm install -g timemachine-exclude

Usage

timemachine-exclude <command> [options]

Commands

  • init: Initializes timemachine-exclude with parent directories to search in and patterns to exclude. This will create a config file in ~/.tm_exclude_config.
  • populate: Finds directories that match your exclude patterns (e.g., node_modules, dist, build) within your specified parent directories and updates the list of exclusions. This will create an exclusions file in ~/.tm_exclusions_tm_exclude.
  • apply: Applies the discovered exclusions to Time Machine.
  • update: Executes populate followed by apply to update exclusions.
  • list: Lists the current Time Machine exclusions in the exclusion file.
  • help: Displays the help message.

Examples

Initialize the tool

timemachine-exclude init

This command prompts you to enter parent directories to search for exclusions, followed by the exclusion patterns. For example:

Initializing timemachine-exclude...
Enter parent directories to search in.
Enter each directory path followed by [ENTER]. When done, enter an empty line.
Directory: ~/Projects
Directory: ~/Workspace
Directory: 

Enter directory names or patterns to exclude.
Enter each pattern followed by [ENTER]. When done, enter an empty line.
Example patterns: node_modules, dist, build, *.cache
Pattern: node_modules
Pattern: dist
Pattern: build
Pattern: 
Configuration saved to /Users/yourusername/.tm_exclude_config

Populate exclusions

timemachine-exclude populate

This command scans the specified parent directories for directories matching the exclusion patterns, then creates a list of full paths in ~/.tm_exclusions_tm_exclude

Populating exclusions...
Searching in: /Users/yourusername/Projects
Excluded: /Users/yourusername/Projects/myproject/node_modules
Searching in: /Users/yourusername/Workspace
Excluded: /Users/yourusername/Workspace/anotherproject/node_modules
Excluded: /Users/yourusername/Workspace/anotherproject/dist

All excluded directories have been listed in /Users/yourusername/.tm_exclusions_tm_exclude

Apply exclusions to Time Machine

timemachine-exclude apply

This command reads the contents of ~/.tm_exclusions_tm_exclude and applies each path to the Time Machine exclusion list.

Applying exclusions to Time Machine...
Added exclusion: /Users/yourusername/Projects/myproject/node_modules
Added exclusion: /Users/yourusername/Workspace/anotherproject/node_modules
Added exclusion: /Users/yourusername/Workspace/anotherproject/dist
All exclusions have been applied to Time Machine.

Update exclusions

timemachine-exclude update

This command runs the populate command to find new exclusions and applies them to Time Machine

List exclusions

timemachine-exclude list

This command outputs the contents of ~/.tm_exclusions_tm_exclude.

Listing current Time Machine exclusions for node_modules:
/Users/yourusername/Projects/myproject/node_modules
/Users/yourusername/Workspace/anotherproject/node_modules
/Users/yourusername/Workspace/anotherproject/dist

Configuration

The tool uses two configuration files in your home directory:

  • ~/.tm_exclude_config: Stores the parent directories to search and exclude patterns, as defined when you run the init command.
  • ~/.tm_exclusions_tm_exclude: Stores the generated list of directories to be excluded from Time Machine backups. This is generated by the populate command.

How it Works

  1. Initialization:
    • The init command allows users to define parent directories for searching and patterns of directories to exclude from the backup. This information is stored in ~/.tm_exclude_config.
  2. Populating Exclusions:
    • The populate command reads configuration details from ~/.tm_exclude_config and searches all specified directories for the patterns provided. Matching directories are listed in ~/.tm_exclusions_tm_exclude.
  3. Applying Exclusions:
    • The apply command reads the exclusion paths from ~/.tm_exclusions_tm_exclude and uses the tmutil command to add them as exclusions in Time Machine.
  4. Updating Exclusions:
    • The update command combines the populate and apply actions, refreshing the list of exclusions based on the current file system and applying those changes to Time Machine.
  5. Listing Exclusions:
    • The list command displays the currently excluded directories in ~/.tm_exclusions_tm_exclude.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.