Socket
Book a DemoInstallSign in
Socket

@flemist/copy-glob-flat

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flemist/copy-glob-flat

Copy files to single directory with auto rename duplicates

0.0.5
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

NPM Version NPM Downloads Build Status Test Coverage

Copy files to single directory with auto rename duplicates

Installation

npm i @flemist/copy-glob-flat

Usage CLI

cp-flat <SOURCE_GLOB1> <SOURCE_GLOB2> ... <DEST_DIR>
cp-flat src/**/*.txt !**/ignore.txt tmp/destDir

Usage module

import {copyGlobFlat} from '@flemist/copy-glob-flat'

/*
Initial:

/source
  /dir
    /dir1
      file.txt
      ignore.txt
    /dir2
      file.txt
      ignore.txt
    file.txt
    ignore.txt
  file.txt
  ignore.txt
/dest
  /file2.txt
    file.txt
  file1.txt
*/

await copyGlobFlat({
  destDir: 'tmp',
  globs: [
    '**/*.txt',
    '**/!ignore.txt',
  ],
})

/*
Result:

/source
  ...
/dest
  /file2.txt
    file.txt
  file.txt   - copied from source/file
  file0.txt  - copied from source/dir/file
  file1.txt
  file3.txt  - copied from source/dir/dir1/file
  file4.txt  - copied from source/dir/dir2/file
*/

Keywords

copy

FAQs

Package last updated on 23 May 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.