Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-contrib-copy

Package Overview
Dependencies
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-copy

Copy files and folders

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
281K
decreased by-27.57%
Maintainers
6
Weekly downloads
 
Created

What is grunt-contrib-copy?

The grunt-contrib-copy package is a Grunt plugin that provides file copying capabilities. It allows you to copy files and directories from one location to another, which is useful for tasks such as preparing files for deployment, creating backups, or organizing project files.

What are grunt-contrib-copy's main functionalities?

Copying individual files

This feature allows you to copy a single file from a source location to a destination location. In this example, 'src/file1.txt' is copied to 'dest/file1.txt'.

{
  "copy": {
    "main": {
      "src": "src/file1.txt",
      "dest": "dest/file1.txt"
    }
  }
}

Copying multiple files

This feature allows you to copy multiple files by specifying an array of source and destination file paths. In this example, 'src/file1.txt' and 'src/file2.txt' are copied to 'dest/file1.txt' and 'dest/file2.txt' respectively.

{
  "copy": {
    "main": {
      "files": [
        {"src": "src/file1.txt", "dest": "dest/file1.txt"},
        {"src": "src/file2.txt", "dest": "dest/file2.txt"}
      ]
    }
  }
}

Copying entire directories

This feature allows you to copy entire directories, including all subdirectories and files. The 'expand' option is set to true to enable dynamic building of the destination paths. The 'cwd' option specifies the current working directory, and 'src' specifies the pattern to match files. In this example, all files and directories under 'src/' are copied to 'dest/'.

{
  "copy": {
    "main": {
      "expand": true,
      "cwd": "src/",
      "src": ["**"],
      "dest": "dest/"
    }
  }
}

Flattening directory structure

This feature allows you to flatten the directory structure when copying files. The 'flatten' option is set to true, which means all files will be copied directly into the destination directory without preserving the directory structure. In this example, all files under 'src/' are copied directly into 'dest/'.

{
  "copy": {
    "main": {
      "expand": true,
      "cwd": "src/",
      "src": ["**"],
      "dest": "dest/",
      "flatten": true
    }
  }
}

Other packages similar to grunt-contrib-copy

Keywords

FAQs

Package last updated on 04 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc