Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

robolocopy

movahhedi140MIT0.1.1TypeScript support: included

A cross-platform file copying utility with glob pattern exclusions

copy, robocopy, file, directory, cli, glob, exclude

readme

Robolocopy CLI

A cross-platform file copying utility with glob pattern exclusions, inspired by Windows' robocopy.

Installation

npm install -g robolocopy

Usage

robolocopy <input-path> <output-path> [-x <exclude-glob>,<exclude-glob>,...] [-X] [-V]

Or specify multiple exclude patterns individually:

robolocopy <input-path> <output-path> [-x <exclude-glob>] [-x <exclude-glob>] [-X] [-V]

Options

  • -x, --exclude <patterns...> - Glob patterns to exclude, can be specified multiple times
  • -X, --ignore-defaults - Ignore default exclusion patterns
  • -V, --verbose - Enable verbose output
  • -v, --version - Output the current version
  • -h, --help - Display help information

Default Exclude Patterns

By default, the following patterns are excluded:

  • node_modules/**
  • dist/**
  • build/**
  • temp/**
  • delete/**
  • bin/**
  • obj/**
  • cache/**
  • tmp/**
  • .DS_Store
  • coverage/**
  • .cache/**
  • .idea/**
  • *.log

Examples

Copy a directory excluding node_modules:

robolocopy ./source ./destination -x "node_modules/**"

Copy with multiple exclusions:

robolocopy ./source ./destination -x "*.log" -x "temp/**"

or comma-separated

robolocopy ./source ./destination -x "node_modules,docs"

Copy with verbose output:

robolocopy ./source ./destination -V

Copy ignoring default exclude patterns:

robolocopy ./source ./destination -X

Performance

On Windows systems, the tool automatically uses the native robocopy command for improved performance when copying directories. On other platforms, it uses an optimized Node.js implementation with batched file operations.