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

folder-structure-sync

v1.1.0

Published

๐Ÿš€ Interactive CLI tool for syncing folder structures with smart selection, dependency handling, and beautiful output

Readme

๐Ÿ“ Folder Structure Sync

npm version License: ISC Node.js Version

๐Ÿš€ Interactive CLI tool for syncing folder structures with smart selection, dependency handling, and beautiful output

Perfect for project templates, development environments, team onboarding, and automated deployments. Sync only what you need with intelligent dependency resolution and comprehensive exclusion patterns.

๐Ÿ“š Table of Contents

โœจ Features

  • ๐ŸŽฏ Interactive Selection: Choose folders with checkbox interface or comma-separated numbers
  • ๐Ÿง  Smart Dependencies: Auto-includes parent folders when children are selected
  • ๐Ÿšซ Smart Exclusions: Configurable patterns with sensible defaults (.git, node_modules, etc.)
  • ๐Ÿ”’ Ignore File Support: Place .ignore file in any folder to skip it and all children during sync
  • ๐ŸŽจ Beautiful Output: Colorful, hierarchical display with progress bars
  • ๐Ÿ“‹ Dry Run Mode: Preview changes safely before execution
  • โšก Auto Mode: Perfect for scripts and CI/CD pipelines
  • ๐Ÿ“Š Detailed Reporting: Comprehensive operation summaries
  • ๐Ÿ”ง Cross-Platform: Works on Windows, macOS, and Linux

๐Ÿš€ Quick Start

# Install globally from npm
npm install -g folder-structure-sync

# Or install locally in your project
npm install folder-structure-sync

# Run interactively
folder-sync ./source-folder ./target-folder

# Preview changes (recommended first run)
folder-sync ./source-folder ./target-folder --dry-run

# Auto-sync everything
folder-sync ./source-folder ./target-folder --auto

๐Ÿ“ฆ Installation

# Global installation (recommended)
npm install -g folder-structure-sync

# Local installation
npm install folder-structure-sync

# Or run directly with npx (no installation needed)
npx folder-structure-sync ./source ./target --dry-run

๐Ÿ“– Usage

๐ŸŽฎ Interactive Mode

The default mode provides a user-friendly selection interface:

folder-sync ./source-project ./target-project

Example interaction:

๐Ÿ“‚ Found 5 missing folders in target:
[1] โœ“ src/
[2] โœ“ src/components/
[3] โœ— src/utils/
[4] โœ“ docs/
[5] โœ“ tests/

๐ŸŽฏ Select folders to create:
   Use arrow keys to navigate, space to toggle, enter to confirm

๐Ÿ”ง Command Options

  • -d, --dry-run: Preview changes without executing
  • -v, --verbose: Show detailed output
  • -a, --auto: Auto-create all missing folders without prompting
  • -h, --help: Show help information

๐Ÿ’ก Common Use Cases

# ๐Ÿ” Preview changes (recommended first!)
folder-sync ./my-template ./new-project --dry-run

# ๐Ÿ—๏ธ Project template setup
folder-sync ./project-template ./new-project --auto

# ๐Ÿ‘ฅ Team environment replication
folder-sync ./team-structure ./my-local-copy

# ๐Ÿ“ฆ Selective sync with verbose output
folder-sync ./large-project ./partial-copy --verbose

# ๐Ÿค– Automation/CI-CD pipeline
folder-sync "$SOURCE" "$TARGET" --auto

โš™๏ธ Configuration

The tool uses a sync-config.json file for exclusion patterns:

{
  "defaultExclusions": [
    ".git",
    ".svn",
    ".hg", // Version control
    "node_modules",
    ".npm",
    ".yarn", // Package managers
    ".DS_Store",
    "Thumbs.db", // OS files
    ".vscode",
    ".idea", // IDE files
    "*.tmp",
    "*.log",
    "*.cache", // Temporary files
    "dist",
    "build",
    ".next" // Build outputs
  ],
  "customExclusions": [
    "my-custom-folder", // Add your patterns here
    "*.backup"
  ]
}

๐Ÿ’ก Pro tip: Customize customExclusions for project-specific needs!

๐ŸŽฏ Smart Features

๐ŸŽฎ Interactive Selection

Two ways to select folders:

  1. Checkbox Interface: Navigate with โ†‘โ†“, toggle with Space, confirm with Enter
  2. Number Input: Type comma-separated numbers like 1,3,5 or ranges 1-5

๐Ÿง  Dependency Resolution

When you select src/components/buttons/, the tool automatically:

  • โœ… Includes parent folders: src/ โ†’ src/components/ โ†’ src/components/buttons/
  • ๐Ÿ“‹ Shows you the complete dependency tree
  • โšก Creates folders in the correct order

๐ŸŽจ Beautiful Output

๐Ÿ” Validating paths...
๐Ÿ“ Scanning directories...

๐Ÿ“‚ Found 5 missing folders:
  [1] src/                    # Root level - cyan
    [2] src/components/       # Level 1 - yellow
      [3] src/components/ui/  # Level 2 - green
  [4] docs/                   # Root level - cyan
  [5] tests/                  # Root level - cyan

๐Ÿš€ Creating folders...
Progress |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 100% | 5/5 folders

๐ŸŽ‰ Success: 5 created, 0 errors

๐Ÿ“ธ Screenshots & Examples

โœ… Success Output

๐ŸŽ‰ Successfully processed 5 folders!
๐Ÿ“Š Summary: 5 created, 0 errors

๐Ÿ“‹ Dry Run Output

๐Ÿ“‹ Dry run - folders that would be created:
  1. /target/src
  2. /target/src/components
  3. /target/docs
  4. /target/tests

๐Ÿ“‹ This was a dry run - no actual changes were made.

โš ๏ธ Error Handling

โŒ Error creating /restricted/folder: EACCES: permission denied
๐Ÿ“Š Summary: 4 created, 1 error

๐Ÿ› ๏ธ Development

# Clone and setup
git clone https://github.com/unique01082/folder-structure-sync.git
cd folder-structure-sync
npm install

# Run tests (when available)
npm test

# Test with sample data
node index.js ./test-source ./test-target --dry-run

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“‹ Roadmap

  • [x] ๐Ÿ“ฆ NPM package publication
  • [ ] ๐Ÿงช Comprehensive test suite
  • [ ] ๐Ÿ“Š File sync capabilities (not just folders)
  • [ ] ๐ŸŒ Configuration presets for popular frameworks
  • [ ] ๐Ÿ” Advanced filtering with regex patterns
  • [ ] ๐Ÿ“ฑ Interactive web interface
  • [ ] โšก Performance optimizations for large directories

โ“ FAQ

Q: Does this tool copy files?
A: No, it only creates folder structures. Files are not copied or modified.

Q: Is it safe to use in production?
A: Yes, especially with --dry-run first. The tool only creates folders and includes comprehensive error handling.

Q: Can I exclude specific patterns?
A: Absolutely! Use sync-config.json to customize exclusion patterns.

Q: Does it work with network drives?
A: Yes, as long as you have appropriate permissions.

๐Ÿ”ง Troubleshooting

Permission Errors: Run with elevated privileges or check folder permissions
Large Directories: Use --verbose to monitor progress
Configuration Issues: Check sync-config.json syntax with a JSON validator

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments


โญ Star this repo if it helped you! | ๐Ÿ› Report bugs | ๐Ÿ’ก Request features