{"id":13826045,"url":"https://github.com/bcomnes/cpx2","last_synced_at":"2026-04-03T19:01:46.128Z","repository":{"id":35079590,"uuid":"204442687","full_name":"bcomnes/cpx2","owner":"bcomnes","description":"Maintenance fork of cpx. A cli tool to watch and copy file globs.  🤞hoping to get this work merged one day.","archived":false,"fork":false,"pushed_at":"2026-03-23T06:33:39.000Z","size":426,"stargazers_count":60,"open_issues_count":6,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T17:42:53.624Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mysticatea/cpx","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcomnes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-26T09:32:03.000Z","updated_at":"2026-03-20T16:19:08.000Z","dependencies_parsed_at":"2024-10-24T21:57:14.992Z","dependency_job_id":"264a4fc5-b52d-4135-b34b-c848638a2b22","html_url":"https://github.com/bcomnes/cpx2","commit_stats":{"total_commits":197,"total_committers":13,"mean_commits":"15.153846153846153","dds":0.6142131979695431,"last_synced_commit":"fd28c28eb640e5613dee4d05e45fb79e7d1f8bab"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/bcomnes/cpx2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fcpx2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fcpx2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fcpx2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fcpx2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcomnes","download_url":"https://codeload.github.com/bcomnes/cpx2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fcpx2/sbom","scorecard":{"id":228711,"data":{"date":"2025-08-11","repo":{"name":"github.com/bcomnes/cpx2","commit":"eb058586905af7bf2dd79f7957e8719b42d483f8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/cpx2/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/cpx2/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/cpx2/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/cpx2/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/cpx2/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/cpx2/test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:29","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:25","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/test.yml:32","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T04:23:13.197Z","repository_id":35079590,"created_at":"2025-08-17T04:23:13.197Z","updated_at":"2025-08-17T04:23:13.197Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31371642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:01:31.339Z","updated_at":"2026-04-03T19:01:46.107Z","avatar_url":"https://github.com/bcomnes.png","language":"JavaScript","readme":"# cpx2\n\n[![npm version](https://img.shields.io/npm/v/cpx2.svg)](https://www.npmjs.com/package/cpx2)\n[![Downloads/month](https://img.shields.io/npm/dm/cpx2.svg)](http://www.npmtrends.com/cpx2)\n[![tests](https://github.com/bcomnes/cpx2/actions/workflows/test.yml/badge.svg)](https://github.com/bcomnes/cpx2/actions/workflows/test.yml)\n\nCopy file globs, watching for changes.\n\nThis module provides a CLI tool like `cp`, but with watching.\n\nThis is a maintained fork of [mysticatea/cpx](https://github.com/mysticatea/cpx).  It retains the `cpx` bin name, so it can act as a drop-in replacement.\n\n## Installation\n\n```\nnpm install cpx2\n```\n\n## Usage\n\n```\nUsage: cpx \u003csource\u003e \u003cdest\u003e [options]\n\n    Copy files, watching for changes.\n\n        \u003csource\u003e  The glob of target files.\n        \u003cdest\u003e    The path of a destination directory.\n\nOptions:\n\n    -c, --command \u003ccommand\u003e   A command text to transform each file.\n    -C, --clean               Clean files that matches \u003csource\u003e like pattern in\n                              \u003cdest\u003e directory before the first copying.\n    -f, --force               Force the file to be copied, even if the\n                              destination is readonly.   \n    -i, --ignore              A comma separated list of gitignore style ignore\n                              patterns.\n    -L, --dereference         Follow symbolic links when copying from them.\n    -h, --help                Print usage information.\n    --include-empty-dirs      The flag to copy empty directories which is\n                              matched with the glob.\n    --no-initial              The flag to not copy at the initial time of watch.\n                              Use together '--watch' option.\n    -p, --preserve            The flag to copy attributes of files.\n                              This attributes are uid, gid, atime, and mtime.\n    -t, --transform \u003cname\u003e    A module name to transform each file. cpx lookups\n                                the specified name via \"require()\".\n    -u, --update              The flag to not overwrite files on destination if\n                              the source file is older.\n    -v, --verbose             Print copied/removed files.\n    -V, --version             Print the version number.\n    -w, --watch               Watch for files that matches \u003csource\u003e, and copy\n                              the file to \u003cdest\u003e every changing.\n```\n\n\n## Example\n\n```\n$ cpx \"src/**/*.{html,png,jpg}\" app --watch\n```\n\nThis example will copy html/png/jpg files from `src` directory to `app`\ndirectory, keeping file tree structure.\nWhenever the files are changed, copy them.\n\n\u003e Since Bash expands globs, requires to enclose it with double quotes.\n\nYou can use together [Browserify](http://browserify.org).\n\n```\n$ cpx \"src/**/*.{html,png,jpg}\" app -w \u0026 watchify src/index.js -o app/index.js\n```\n\nYou can use shell commands to convert each file.\n\n```\n$ cpx \"src/**/*.js\" app -w -c \"babel --source-maps inline\"\n```\n\nYou can use the transform packages for Browserify.\n\n```\n$ cpx \"src/**/*.js\" app -w -t babelify -t uglifyify\n```\n\nIt maybe can use to add header comment, to optimize images, or etc...\n\n\n## Node.js API\n\nYou can use this module as a node module.\n\n```js\nvar cpx = require(\"cpx2\");\n```\n\n### cpx.copy\n\n```ts\ncpx.copy(source, dest, options, callback)\ncpx.copy(source, dest, callback)\n```\n\n- **source** `{string}` -- A file glob of copy targets.\n- **dest** `{string}` -- A file path of a destination directory.\n- **options** `{object}`\n  - **options.clean** `{boolean}` -- The flag to remove files that copied on past before copy. Default: `false`.\n  - **options.dereference** `{boolean}` -- The flag to follow symbolic links when copying from them. Default: `false`.\n  - **options.includeEmptyDirs** `{boolean}` -- The flag to copy empty directories which is matched with the glob. Default: `false`.\n  - **options.initialCopy** `{boolean}` -- The flag to not copy at the initial time of watch. This is for `cpx.watch()`. Default: `true`.\n  - **options.force** `{boolean}` -- The flag to copy file to the destination, even if it is readonly.\n  - **options.preserve** `{boolean}` -- The flag to copy uid, gid, atime, and mtime of files. Default: `false`.\n  - **options.transform** `{((filepath: string) =\u003e stream.Transform)[]}` -- Functions that creates a `stream.Transform` object to transform each copying file.\n  - **options.update** `{boolean}` -- The flag to not overwrite files on destination if the source file is older. Default: `false`.\n  - **options.ignore** `{string|Array\u003cstring\u003e}` -- A gitignore style string or array of strings that make ignoring directory patterns easier. Default: []\n- **callback** `{(err: Error|null) =\u003e void}` -- A function that is called at done.\n\nCopy files that matches with `source` glob to `dest` directory.\n\n### cpx.copySync\n\n```ts\ncpx.copySync(source, dest, options)\ncpx.copySync(source, dest)\n```\n\nA synchronous function of `cpx.copy`.\n\nArguments is almost same as `cpx.copy`.\nBut `options.transform` is not supported.\n\n### cpx.watch\n\n```ts\ncpx.watch(source, dest, options)\ncpx.watch(source, dest)\n```\n\nCopy files that matches with `source` glob string to `dest` directory.\nAfter the first copy, starts observing.  And copy the files when every changes.\n\nArguments is same as `cpx.copy`.\n\n`cpx.watch` returns an `EventEmitter`.\n\n- `.on(\"copy\", (e) =\u003e { ... })` : Be fired after file is copied. `e.srcPath` is a path of original file. `e.dstPath` is a path of new file.\n- `.on(\"remove\", (e) =\u003e { ... })` : Be fired after file is removed. `e.path` is a path of removed file.\n- `.on(\"watch-ready\", () =\u003e { ... })` : Be fired when started watching files, after the first copying.\n- `.on(\"watch-error\", (err) =\u003e { ... })` : Be fired when occured errors during watching.\n\n## Changelog\n\n[GitHub Releases](https://github.com/bcomnes/cpx2/releases)\n\n## Contributing\n\nThank you for contributions!\n\n### Bug Reports or Feature Requests\n\nPlease use GitHub Issues.\n\n### Document Corrections\n\nPlease use GitHub Pull Requests.\nI would especially thank for document corrections since I'm not familiar with English.\n\n### Feature Implementing\n\nPlease use GitHub Pull Requests.\n\nThere are some npm-scripts to help developments.\n\n- `npm test` - Run tests and collect coverage.\n- `npm run build` - Make lib directory from src directory.\n- `npm run clean` - Delete directories (folders) which are created by other commands.\n- `npm run lint` - Run ESLint.\n- `npm run watch` - Run tests (not collect coverage) when each file was modified.\n- `npm run open-coverage` - Open the coverage report of the last `npm test` command with web browser.\n","funding_links":[],"categories":["JavaScript","Utilities"],"sub_categories":["Project Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fcpx2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcomnes%2Fcpx2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fcpx2/lists"}