{"_id":"@alloc/cpx","_rev":"3-04ec0491cfde73dd3370d8cb7c66c4d7","name":"@alloc/cpx","dist-tags":{"latest":"1.6.1"},"versions":{"1.5.0":{"name":"@alloc/cpx","version":"1.5.0","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","gitHead":"d974de1ab73909e76296a9b725cad4dd437cb80a","_id":"@alloc/cpx@1.5.0","_nodeVersion":"11.10.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-6V+atvADPYxubkO/RqUr8EHnf3Ok+dSAz47keG/lJb3j8VLHzXVSrBgv0gIqXNqgXQTqenAta3/PDY+v5Ly+Gg==","shasum":"ba8809b45ed921571d781e8d0ea468ee66619642","tarball":"https://registry.npmjs.org/@alloc/cpx/-/cpx-1.5.0.tgz","fileCount":20,"unpackedSize":66809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczuIGCRA9TVsSAnZWagAA15kP/19xMFFnHRHuVZfqAYoJ\n+x3H+gLwo+oGS47uRu9by2oS7gLKUv/Ky6jbWq1F7F1ayGCAMHvoa4uvGfeA\nPscvpkF6k0G2VoZjbgu7Oi2DCq+20H4bouV2AB/tsu2g2T883qjfPU9NZli8\n7DG5oru7pxIraP0k/ZSNhiZEzCD7KvBqMwmgiRBMZ61mNgypJ6QNfNXc0ePV\nBS7kWjL3I/M3aAZelrTb5g/PuG+gqtlsjdoDrDf0JcCg/0nXxxJvE5RuzXsH\njfYfXhh7D2YPHjNlmiRk5Fn0/9FIiN9sNvQYrutNgX8sFIugAUrR7IL3jMLa\novVCqCS/SEKPuP5mR6DEp3t8/LahsvawHuKlNa1/D+ZRJTr2XAczrgPyZcbb\nFN1NVhQvMtOXa3ubVyFS/anw0TPvD2yf9V+olMhDVq97uWPMwdGt1yo5yUZH\nnBon2VXa2irimqjqFUocEVoZxeM/ClA32xIAoDgmfJFUbYuedmYJQR83R0Sm\nrogq6WqFnVQvE7mfl0H6QLMZe6aFMG/JzhCZ0EBK0FLHRog12oE1551OzEgZ\nG+Lil0jtVP5eHszhg27z3vY0SZ6z1MXjPT7/fOOGKu9CZgONWlcAp8NkLmv7\nAXBn/oIkSuA52FASyrIUK8MVB6A9VqnSu8B5SRliSQMXgXYrzrOfk+Badty4\nXw8l\r\n=Mtg4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXfWRZ0qEAO42pVK1eYKNKvQcdC/aZAq/o+/vpsOpCdAiAdB+iNV4O2dVwGhB8cL4vRvDdxjbgZnq5nm1AFb1eV2g=="}]},"maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.5.0_1557062149861_0.15637039252848228"},"_hasShrinkwrap":false},"1.6.0":{"name":"@alloc/cpx","version":"1.6.0","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","gitHead":"b76da5a17506caf914a8706eb6ed86b13b99e272","_id":"@alloc/cpx@1.6.0","_nodeVersion":"11.10.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-CjXjsR0yxIXMlMf2siR1iJHsSiBG0CzdF8PxBjMjPOOL8l61TomF1VkO6ZvgN5lMbuS9W13WRDNUHMSaM0EA/w==","shasum":"f4b577e988a52f1fb91c79ca3094b4e11555b266","tarball":"https://registry.npmjs.org/@alloc/cpx/-/cpx-1.6.0.tgz","fileCount":20,"unpackedSize":67080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczwFvCRA9TVsSAnZWagAAFZ4QAJU1iGr3IUOBsGRpiyUW\nZMEe48uq4ZAxYGOVFsEfS6uqjWKVK5/aEIR/7iSS7i7PYZWxD7k4kdT8pAM+\n3819j1MzAORzhzyJ16tIbnu1yeFCngAvROpcd/9JE21ghUgp1DB924+3dOAk\nchGwVcpsZ2e9h9gZ/2dcLcAGo7xIWx3P5Na8OXzZrBaN6GMtgFuuz+kfnIi/\n69rQhckNYfptEScE8VJP4iHG3uYDwrtrPt/vMFbNt+XaJ8mbS/shNX/hlK4G\nwPrml6zWkxYPCXA30dDcZ4gGjDPvNSLkw26eSV769cf2IRaleofd835v9JOi\n+bJ7NSDtmuD4bFB4SJJkkPRUvpwFKiZT002i0b85eAgn0/6GT1MpBXhWRW1j\nTrkrKY0A763SRMwgpZSnpr9JgvdFfsSpNk/9M/tviv3pjBZTz0eWij436BZY\nIfJetbLGsVeLBu685U08gAfkChlEYdA8xVvXci7YeQw3e6oS/rX4ULMNWeDP\nmV1IWUzQnh+CEgsQ1f2fhu47TESEr4yhDGOH1h2jmCMCLFfLdthCJNE3i2Lp\nKxxe5Ev7IWOeyF75hITSgqQCs2rF9Z3IHJZhlyGMfo45n7dX32mRn8Rm2WbB\nb3H35vu6rCOMvzs02xeJ62aCaLgdWy+HPIhMm+srba0rT6kqN5ROxxRFLyHl\nPuQH\r\n=50dU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJtQOnzInz9jdyhb9YgsZRV8fFriCGa6ebKK2fWXtE7wIhAKVjGAm5dmFQ3ukiEaHWcV2+bj3rsbwz1iCsvqOqIoIQ"}]},"maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.6.0_1557070190727_0.9511336774542378"},"_hasShrinkwrap":false},"1.6.1":{"name":"@alloc/cpx","version":"1.6.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","gitHead":"5b515111d540241b674914f6752c7ee7648be99c","_id":"@alloc/cpx@1.6.1","_nodeVersion":"11.10.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-5mKm4LMr4+KCIyIHrVnSITCv8dxN4W1qk+xXnFPss2veO7dnaS/nwh8AWBbxscvpFM/R0isi3cvbBLKLay6lkQ==","shasum":"4f9e68248963d564df586837b148b0692fc38285","tarball":"https://registry.npmjs.org/@alloc/cpx/-/cpx-1.6.1.tgz","fileCount":20,"unpackedSize":67059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0XxQCRA9TVsSAnZWagAAxJMP/0pRuoaDEMqlKwWsDeVO\nwldjNpoUKERZtVFA4QlAe0x54vys/bdkqUFP2phccBhbSwFyk+oe/mFgMuSN\nNH2KUHL9dTaUAr0g5X8YoZupwCSCt8YsS4JZEHQzXRM+JRa5mHDGFQ6bGSvR\nasLeRBR8aAX2bEp7k2NXiAJIC3bIf9at6Z/Tg7+rqEsivhAcZmj2tlS9ZqO1\naBnzbvvyjXBZL5m8nP2mFNHQzSsTEeBSxq/mchlJv7O8Md1QstIj490oDM7M\nFQ19QCyZ56AtUYW7vXcDL2fgq0y4dCYdyZGDxjw2c7cpuGdLfkFv6f8rFsRD\nxHKRQRM8NtGvTTBe6YkHYPCW1UuSbWB+7xHCjQfTSRhCPvyBkzHff/TEjzB2\nvosbrVdgKaImaz8e0rLruBjhDIaCWcU1ddU4aL1XGFPyherzRUATgqQsQUBX\nXn1kPEt4gRoKdMWQWI3nIkpRdl8UsNCIcaalwEoXLSV/WRHdZ27EWOxOcIx8\nbeMDPcv8TT/Qn4GqnMhDg5K5KoYBtVN+XdD/tmDZc7lB2pdNy4jGJ4kZRIp7\ndu6tWmvtcx0OxHRVzzfbxSuB0yTOrXpoEGIFUfOB2d+IEvXTzeF/8jK/i5IW\n02V7xHaAzv9OzeNOGn2Mccz7LT5A/ibhOFC6lGYo8vUzPJS10eCntrkDwHOg\n8ySQ\r\n=AEgo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEq12ACFyEYmbiRX3utYLIEknbBHU2LLhUPqQ6EJOrAuAiBFM34KitOob1VCO2y8npL5FMe8Aj3W5ICJRBit0EkViQ=="}]},"maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"}],"_npmUser":{"name":"aleclarson","email":"alec.stanford.larson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.6.1_1557232719462_0.14674422903987838"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-05T13:15:49.666Z","1.5.0":"2019-05-05T13:15:50.035Z","modified":"2022-04-04T13:33:35.282Z","1.6.0":"2019-05-05T15:29:50.851Z","1.6.1":"2019-05-07T12:38:39.570Z"},"maintainers":[{"name":"aleclarson","email":"alec.stanford.larson@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"}