Gathering detailed insights and metrics for cpy
Gathering detailed insights and metrics for cpy
Gathering detailed insights and metrics for cpy
Gathering detailed insights and metrics for cpy
cpy-cli
Copy files
cpy-ui
``` ^v0.2.0 console ^v1.0.0 适用于portal ^v2.0.0 适用于自用admin-partner ^v3.0.0 适用于自用mita-portal ^v4.0.0 适用于自用测试 ``` ## Project setup ``` yarn install ```
rollup-plugin-cpy
rollup plugin to easily copy files and folders.
@types/cpy
Stub TypeScript definitions entry for cpy, which provides its own types definitions
npm install cpy
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.9
Supply Chain
99
Quality
76.3
Maintenance
100
Vulnerability
100
License
JavaScript (92.73%)
TypeScript (7.27%)
Total Downloads
568,857,605
Last Day
85,908
Last Week
1,622,892
Last Month
7,031,481
Last Year
78,337,401
MIT License
429 Stars
131 Commits
63 Forks
12 Watchers
1 Branches
29 Contributors
Updated on May 08, 2025
Latest Version
11.1.0
Package Id
cpy@11.1.0
Unpacked Size
18.49 kB
Size
6.03 kB
File Count
7
NPM Version
10.6.0
Node Version
18.20.2
Published on
Jul 26, 2024
Cumulative downloads
Total Downloads
Last Day
-22.5%
85,908
Compared to previous day
Last Week
-9.9%
1,622,892
Compared to previous week
Last Month
8.3%
7,031,481
Compared to previous month
Last Year
-36.3%
78,337,401
Compared to previous year
Copy files
IMPORTANT: This package has a lot of problems and I unfortunately don't have time to fix them. I would recommend against using this package until these problems are resolved. Help welcome (see the issue tracker) 🙏
1npm install cpy
1import cpy from 'cpy'; 2 3await cpy([ 4 'source/*.png', // Copy all .png files 5 '!source/goat.png', // Ignore goat.png 6], 'destination'); 7 8// Copy node_modules to destination/node_modules 9await cpy('node_modules', 'destination'); 10 11// Copy node_modules content to destination 12await cpy('node_modules/**', 'destination'); 13 14// Copy node_modules structure but skip all files except package.json files 15await cpy('node_modules/**/*.json', 'destination'); 16 17// Copy all png files into destination without keeping directory structure 18await cpy('**/*.png', 'destination', {flat: true}); 19 20console.log('Files copied!');
Returns a Promise<string[]>
with the destination file paths.
Type: string | string[]
Files to copy.
If any of the files do not exist, an error will be thrown (does not apply to globs).
Type: string
Destination directory.
Type: object
Options are passed to globby.
In addition, you can specify the below options.
Type: string
Default: process.cwd()
Working directory to find source files.
Type: boolean
Default: true
Overwrite existing files.
Type: boolean
Default: false
Flatten directory structure. All copied files will be put in the same directory.
1import cpy from 'cpy'; 2 3await cpy('src/**/*.js', 'destination', { 4 flat: true 5});
Type: string | Function
Filename or function returning a filename used to rename every file in source
.
1import cpy from 'cpy'; 2 3await cpy('foo.js', 'destination', { 4 // The `basename` is the filename with extension. 5 rename: basename => `prefix-${basename}` 6}); 7 8await cpy('foo.js', 'destination', { 9 rename: 'new-name' 10});
Type: number
Default: (os.cpus().length || 1) * 2
Number of files being copied concurrently.
Type: boolean
Default: true
Ignores junk files.
Type: Function
Function to filter files to copy.
Receives a source file object as the first argument.
Return true to include, false to exclude. You can also return a Promise that resolves to true or false.
1import cpy from 'cpy'; 2 3await cpy('foo', 'destination', { 4 filter: file => file.extension !== 'nocopy' 5});
Type: string
Example: '/tmp/dir/foo.js'
Resolved path to the file.
Type: string
Example: 'dir/foo.js'
if cwd
was '/tmp'
Relative path to the file from cwd
.
Type: string
Example: 'foo.js'
Filename with extension.
Type: string
Example: 'foo'
Filename without extension.
Type: string
Example: 'js'
File extension.
Type: Function
1{ 2 completedFiles: number, 3 totalFiles: number, 4 completedSize: number, 5 percent: number, 6 sourcePath: string, 7 destinationPath: string, 8}
completedSize
is in bytespercent
is a value between 0
and 1
sourcePath
is the absolute source path of the current file being copied.destinationPath
is The absolute destination path of the current file being copied.Note that the .on()
method is available only right after the initial cpy
call, so make sure you add a handler
before awaiting the promise:
1import cpy from 'cpy'; 2 3await cpy(source, destination).on('progress', progress => { 4 // … 5});
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More