{"_id":"@akryum/cpx","_rev":"3-b8ba6710dda9bb4875d165f87daf8081","name":"@akryum/cpx","dist-tags":{"latest":"1.5.3"},"versions":{"1.5.1":{"name":"@akryum/cpx","version":"1.5.1","description":"Copy file globs, watching for changes.","engines":{"node":">=6.5"},"main":"lib/index.js","bin":{"cpx":"bin/index.js"},"scripts":{"_mocha":"_mocha \"test/*.js\" --timeout 15000","clean":"rimraf .nyc_output coverage test-ws","codecov":"nyc report -r lcovonly && codecov","coverage":"nyc report -r lcov && opener coverage/lcov-report/index.html","lint":"eslint bin lib test","postversion":"git push && git push --tags","pretest":"npm run -s lint","preversion":"npm test","test":"nyc --require babel-register npm run -s _mocha","watch":"npm run -s _mocha -- --require babel-register --watch --growl"},"dependencies":{"co":"^4.6.0","debounce":"^1.1.0","debug":"^3.1.0","duplexer":"^0.1.1","fs-extra":"^6.0.1","glob":"^7.1.2","glob2base":"0.0.12","minimatch":"^3.0.4","resolve":"^1.8.1","safe-buffer":"^5.1.2","shell-quote":"^1.6.1","subarg":"^1.0.0"},"devDependencies":{"@mysticatea/eslint-plugin":"^5.0.1","babel-preset-power-assert":"^2.0.0","babel-register":"^6.26.0","codecov":"^3.0.2","eslint":"^5.0.1","mocha":"^5.2.0","nyc":"12.0.2","opener":"^1.4.3","p-event":"^2.0.0","power-assert":"^1.6.0","rimraf":"^2.6.2","shelljs":"^0.8.2","through":"^2.3.8"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/cpx.git"},"keywords":["cp","cli","tool","commandline","sync","rsync","watch","observe","copy","dir","directory","directories","file","files"],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/cpx/issues"},"homepage":"https://github.com/mysticatea/cpx","publishConfig":{"access":"public"},"gitHead":"6603789f5cf0e8c3de95095392b8e4522407cecf","_id":"@akryum/cpx@1.5.1","_nodeVersion":"15.13.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-JvIyMJxqNOc/IEmyXHbo5WaydsFYummbXXt9kBonrMvXNKuQh4ZVYdw2QRCExhIBoq8fbwhtrWlcmS6K767xJw==","shasum":"6bc367b1953cb5ada4935849d7e5444fecd5bcd4","tarball":"https://registry.npmjs.org/@akryum/cpx/-/cpx-1.5.1.tgz","fileCount":20,"unpackedSize":67121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgafz7CRA9TVsSAnZWagAACycP/2Re0LePqGbe5xBaKnqj\nzAVUr/RSzvaJ9Pw2fc2ByxvZniC1rUig3jXVCb93eOlwtVN2q9U9JlAk1z1X\nCxUBlOQzmQXl1VYPZzjdfLZmXfGUA3ZUfwVcv6/2fBKHBOKsgqHKUXLdtbqx\nmiYOJxGjmt3OIWksg15IhlFe5K6HVh2ee0wYSWbxB/3FLBF431jYcRzWQbjo\n0fpM0k+qPtO+R/Y5Kf4REQ/0hkmGcC6QayfDqx0D+YLJ5qnbhGp90o2dwNLJ\n8c7iGpAtDcNbWgAXP+QdAj+Ysp97VIurO0cpjRuMHp9gPHcYQtsYtXaafDAh\nNOBJMfEq4LUCer4PDcaI7eXsHW37pabHvRxra5vdfNKAPdCYWX+iHBIhhNlH\nT4VMUuSvnjJF1ANz7uv9OdRhpqMEPfbpXvmgIJWIRrJhyL5gFlNykDNCsA93\nqdU/pxUXsexam5TckNtt+TxsRxQTqmlEf8fEmPKyxJuqi7H0HetB/AUjFvgM\ntcA0BfdPM6Kpin2FJGEIDOlhLq2l6YKYzWCTXnTHKvU4kS0GleHIg5ibTXx9\noYkdNlfprYwSSjiE80iV6Cutgtk6bMirpsZ4Jh5S2c489e7nSyrucJ7QmPvV\n1rATYCEzgT4ZfCNeIS17B3sehtsuxyJ8U8ew+dnEfAJzYSawnbN61pnsNLrx\nMu09\r\n=hOmQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9kYqNYP2e3J3h3eqz3xP3JkGW0P7/VAw3I3TTHZoP8gIgLpEn2GGdkXXRwczYRmCjOyEwfhhbFH/7Mjsca6pfYaw="}]},"_npmUser":{"name":"akryum","email":"guillaume.b.chau@gmail.com"},"directories":{},"maintainers":[{"name":"akryum","email":"guillaume.b.chau@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.5.1_1617558778998_0.6647371157882718"},"_hasShrinkwrap":false},"1.5.2":{"name":"@akryum/cpx","version":"1.5.2","description":"Copy file globs, watching for changes.","engines":{"node":">=6.5"},"main":"lib/index.js","bin":{"cpx":"bin/index.js"},"scripts":{"_mocha":"_mocha \"test/*.js\" --timeout 15000","clean":"rimraf .nyc_output coverage test-ws","codecov":"nyc report -r lcovonly && codecov","coverage":"nyc report -r lcov && opener coverage/lcov-report/index.html","lint":"eslint bin lib test","postversion":"git push && git push --tags","pretest":"npm run -s lint","preversion":"npm test","test":"nyc --require babel-register npm run -s _mocha","watch":"npm run -s _mocha -- --require babel-register --watch --growl"},"dependencies":{"co":"^4.6.0","debounce":"^1.1.0","debug":"^3.1.0","duplexer":"^0.1.1","fs-extra":"^6.0.1","glob":"^7.1.2","glob2base":"0.0.12","minimatch":"^3.0.4","resolve":"^1.8.1","safe-buffer":"^5.1.2","shell-quote":"^1.6.1","subarg":"^1.0.0"},"devDependencies":{"@mysticatea/eslint-plugin":"^5.0.1","babel-preset-power-assert":"^2.0.0","babel-register":"^6.26.0","codecov":"^3.0.2","eslint":"^5.0.1","mocha":"^5.2.0","nyc":"12.0.2","opener":"^1.4.3","p-event":"^2.0.0","power-assert":"^1.6.0","rimraf":"^2.6.2","shelljs":"^0.8.2","through":"^2.3.8"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/cpx.git"},"keywords":["cp","cli","tool","commandline","sync","rsync","watch","observe","copy","dir","directory","directories","file","files"],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/cpx/issues"},"homepage":"https://github.com/mysticatea/cpx","publishConfig":{"access":"public"},"gitHead":"cbbe2045d964e105033cd73c0289cca4a01ea7e0","_id":"@akryum/cpx@1.5.2","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-ORTB+y7Ra49SksX7hZp9S09fl3FZ799K3KvbuH0ElP5JDu4Azmx2NGAbnGeP1ToaWBWDdcwFnrfu+0I8B9n1lg==","shasum":"8ea41729f243e0ea7a2a1f7e0802ba3e68e361be","tarball":"https://registry.npmjs.org/@akryum/cpx/-/cpx-1.5.2.tgz","fileCount":20,"unpackedSize":67188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7tlgCRA9TVsSAnZWagAAbEYP/Aiy5IQt6wmhcWsehwf7\nAiz4lLNMEJgXMSdFsp0FFseJ5I7pLFc6siSAu57S10NpLaR0mhj72BL/OkkX\n6/XohQwAmU8x88UhDn42AlFKn/e7a9a+prN3ODanPAo6VeZEgCFPdBbKiH4T\nvC3Flsu4sxkSVcgEVNfxIQryQVGuq7hUNA984Q/0jYKXZjLQPQTtbq3w1eRf\nLFeZv3HJ00SauzK/tfdXYqvM6+ap9MEbEO2RsaPj2vO1s9GpzqaTRm2K+1FY\nN+GC8NnqJqT/tlhTFkYrBj5KTI48x8OrY3O+VDVI2gbTXqPg410RGIp3z/Ym\nmdeujgZsgwRmtnv8Ljs9qzXXyEcMLbXrMLTn01vFENS8plWthFXTc1BN5OV5\nJAf2EGuxxErfePc1/lonwDVVX+mw5FR/Zy55F/ZbIejhjdX9o37BFrmC7A0F\nZXxfNvIRJpO0C2Ul748HdMi21K/rMTR5k+D4Qp8gTNaRZVScSdLPMgao1NO6\nKCfe+qMfwYrZqYaHcZKVDdBictFmdLFFIc1JyuO5Rf8mtQ7zbACC0TozJGQY\nrWDfbUj/w8is0vW7Ea+G51YOGy3os9ezckuvEp7yeWpw3KJryngtkzctC4Wn\nSmnErmR27EFWhNydIKTtuxYF7rvMjaFJTyBuQbK6h5nNEP088dgNmAiL8FuP\noS5a\r\n=3u1g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnOL27S10zFLE2VKDimeJnQryG0XjHj/5Qm5YgoUH3gAiAhG6u+sLxjcbQXtK60HN9QNYUlUfJANyIuvh4Ij8y1JQ=="}]},"_npmUser":{"name":"akryum","email":"guillaume.b.chau@gmail.com"},"directories":{},"maintainers":[{"name":"akryum","email":"guillaume.b.chau@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.5.2_1626265951570_0.04263716125739392"},"_hasShrinkwrap":false},"1.5.3":{"name":"@akryum/cpx","version":"1.5.3","description":"Copy file globs, watching for changes.","engines":{"node":">=12.0"},"main":"lib/index.js","bin":{"cpx":"bin/index.js"},"scripts":{"_mocha":"_mocha \"test/*.js\" --timeout 15000","clean":"rimraf .nyc_output coverage test-ws","codecov":"nyc report -r lcovonly && codecov","coverage":"nyc report -r lcov && opener coverage/lcov-report/index.html","lint":"eslint bin lib test","postversion":"git push && git push --tags","pretest":"npm run -s lint","preversion":"npm test","test":"nyc --require babel-register npm run -s _mocha","watch":"npm run -s _mocha -- --require babel-register --watch --growl"},"dependencies":{"co":"^4.6.0","debounce":"^1.1.0","debug":"^3.1.0","duplexer":"^0.1.1","fs-extra":"^6.0.1","glob":"^7.1.2","glob2base":"0.0.12","minimatch":"^3.0.4","resolve":"^1.8.1","safe-buffer":"^5.1.2","shell-quote":"^1.6.1","subarg":"^1.0.0"},"devDependencies":{"@mysticatea/eslint-plugin":"^5.0.1","babel-preset-power-assert":"^2.0.0","babel-register":"^6.26.0","codecov":"^3.0.2","eslint":"^5.0.1","mocha":"^5.2.0","nyc":"12.0.2","opener":"^1.4.3","p-event":"^2.0.0","power-assert":"^1.6.0","rimraf":"^2.6.2","shelljs":"^0.8.2","through":"^2.3.8"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/cpx.git"},"keywords":["cp","cli","tool","commandline","sync","rsync","watch","observe","copy","dir","directory","directories","file","files"],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/cpx/issues"},"homepage":"https://github.com/mysticatea/cpx","publishConfig":{"access":"public"},"gitHead":"d4ec5be22146c61930c85c5da422653d7a048189","_id":"@akryum/cpx@1.5.3","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-saE9ZrzIiqORXQBj4DoRT86xYy/ii0amJxRo/t39r589XVnx09K6ehgCjr1Bp3jvMpYJZjU2ntwp2QIcyRSAeQ==","shasum":"7380413bfc32780560e734a13a86e472c3ed30ad","tarball":"https://registry.npmjs.org/@akryum/cpx/-/cpx-1.5.3.tgz","fileCount":20,"unpackedSize":66055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBBL1CRA9TVsSAnZWagAAFwkP/3ku02tNrM++T8+YYgIb\ntRjs3qMXa+MmbubrSN6IDLLUtF1AtgZtGG8wLJX2XcMtIKHyguiCiCeHiGu+\nVTtB//nDufoDn5fRXhRm2KKLRg3Y8fRQl45bRbs2fWdAiJzdXzW1YaefDryD\ntT0Jv4DlgG6edPsBbYhEC4Gul0fDXI1VP2Xn+EAETTsMh0B/LdaUkos6gBkD\nr+KFLx1K+ND4g3GXrCTu/mctpHixruruKxj9vaWmYPRzYPzUB/WkQvPrQAYn\nqmUmq8Nzl7rAL2OMb02u/qzDcAXs0yJbPJTah2KQgP4vPtLcz+iccP477zP3\nVPHLFQ6Eh2lpiwVbQdpHFKwvr7cm6Gm977mLwooDFkqu7ckBEWDGWHuQYcpy\nKHwlX/ZGW50KNG4w3dkcCVICQQHgpSgy+OnGPRi9W+y08ta+b9LxKJAQpiK7\nKghFTDu2mDI6UWpP0GTw+D/ZXjr7XV6GljcD1PxQQGSlpJj+wTfGNQFU1LNm\noy6EYFUk/sLiozNENy625zL6zRjrfS4sYJQz2nYaf+fEJdNzkoninWCkkmah\nPJh99SWDt97nKMGz4PbsegGITb9ohM7Y+tQKXBUVJTAuV3ffiKLLPgLTmKrN\nd6etUpwuiJTjWb77rEy1YihSx0N3Ir+RX6pqQTOkYgOisnaRsG/cDlHZvuVP\nAsNE\r\n=q8CR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb46KXtB8ZY6TYjfw5N0JNx1X7XlQi/leHc4edZ1J5BQIgEpaTet4BMcFsWuRjP2YGfBkQrJ8FE1c1IbUb2RrwoPA="}]},"_npmUser":{"name":"akryum","email":"guillaume.b.chau@gmail.com"},"directories":{},"maintainers":[{"name":"akryum","email":"guillaume.b.chau@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.5.3_1627656949294_0.38206842800283947"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-04T17:52:58.949Z","1.5.1":"2021-04-04T17:52:59.136Z","modified":"2022-04-04T12:31:18.167Z","1.5.2":"2021-07-14T12:32:31.778Z","1.5.3":"2021-07-30T14:55:49.400Z"},"maintainers":[{"name":"akryum","email":"guillaume.b.chau@gmail.com"}],"description":"Copy file globs, watching for changes.","homepage":"https://github.com/mysticatea/cpx","keywords":["cp","cli","tool","commandline","sync","rsync","watch","observe","copy","dir","directory","directories","file","files"],"repository":{"type":"git","url":"git+https://github.com/mysticatea/cpx.git"},"author":{"name":"Toru Nagashima"},"bugs":{"url":"https://github.com/mysticatea/cpx/issues"},"license":"MIT","readme":"# cpx\n\n[![npm version](https://img.shields.io/npm/v/cpx.svg)](https://www.npmjs.com/package/cpx)\n[![Downloads/month](https://img.shields.io/npm/dm/cpx.svg)](http://www.npmtrends.com/cpx)\n[![Build Status](https://travis-ci.org/mysticatea/cpx.svg?branch=master)](https://travis-ci.org/mysticatea/cpx)\n[![codecov](https://codecov.io/gh/mysticatea/cpx/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/cpx)\n[![Dependency Status](https://david-dm.org/mysticatea/cpx.svg)](https://david-dm.org/mysticatea/cpx)\n\nCopy file globs, watching for changes.\n\nThis module provides a CLI tool like `cp`, but with watching.\n\n\n## Installation\n\n```\nnpm install cpx\n```\n\n- Requires Node.js `>=6.5`.\n\n## Usage\n\n```\nUsage: cpx <source> <dest> [options]\n\n    Copy files, watching for changes.\n\n        <source>  The glob of target files.\n        <dest>    The path of a destination directory.\n\nOptions:\n\n    -c, --command <command>   A command text to transform each file.\n    -C, --clean               Clean files that matches <source> like pattern in\n                              <dest> directory before the first copying.\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 <name>    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 <source>, and copy\n                              the file to <dest> 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> 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 & 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(\"cpx\");\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.preserve** `{boolean}` -- The flag to copy uid, gid, atime, and mtime of files. Default: `false`.\n  - **options.transform** `{((filepath: string) => 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- **callback** `{(err: Error|null) => 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) => { ... })` : 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) => { ... })` : Be fired after file is removed. `e.path` is a path of removed file.\n- `.on(\"watch-ready\", () => { ... })` : Be fired when started watching files, after the first copying.\n- `.on(\"watch-error\", (err) => { ... })` : Be fired when occured errors during watching.\n\n## Changelog\n\n[GitHub Releases](https://github.com/mysticatea/cpx/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","readmeFilename":"README.md"}