{"_id":"@deboxsoft/cpx","_rev":"2-d54b017e3ef97a830b340acfb755f273","name":"@deboxsoft/cpx","dist-tags":{"latest":"1.5.0"},"versions":{"1.5.0":{"name":"@deboxsoft/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":"^13.3.0","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":"237e1234d5b2c592657746a6ba34553e10463508","_id":"@deboxsoft/cpx@1.5.0","_nodeVersion":"10.7.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-4hkpKja/1jn+mxpGM3oczee2qXGGChunQYYnORIc7U+91XZPzSdXtvVr/yeH//rnM3Sl9QWzUjMKN9I+IqKu9g==","shasum":"c02e976d9ca2d4bf697c4b4b005816e8e8f3eca3","tarball":"https://registry.npmjs.org/@deboxsoft/cpx/-/cpx-1.5.0.tgz","fileCount":20,"unpackedSize":66786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2SMMCRA9TVsSAnZWagAAS8gP/0jIN6mwLUMLk1hH3s7x\nk5oX4inmy4GdCL175DeoSsf0uZ9WMhANrPaPLRHwdyADni7DEvcvqm6f5+J6\nwopAnev4K2Fab19CUH4l/FaHdRXyQNiQO+Y1yts/UOzbuX9fKH0tPp5w9fHA\nyMsUTIV5fIgYtiFSXzwXiqw+rZYHe73AShhPO8jXP89usChdtqrBu6R+BT0I\nJ48zo7iEr1vF6zO1R2NUDLhCe56UYGUU7lmII6KaiW4OtS4NAGHdbW2vTMm+\nF/ndMoaBls05hnDF+kH8o6QvClCN5qAoXH2ZUzvLulmgGpagkyj7BhW3fSR8\nYCQWhzimplNxoz+pHiZkWO354xhl2viwg7O6mnM1Q7j5hLLe4v1Zt7HzTF8B\nt2e0H664IE3EgMvFZjD2FpScxlC77EdkGOmpsLrTasemn9uYsNjzCTb19Y/W\n0XP9KEJIQLvO4k4tBWaRR9qnNuxleHznobNclkCUm2iiBu37oga/j7S8qyMF\n1U2F98MBxcgXjXggnpRStk8WSLODNsC9RVNPg+vQKRm0oAc8inCneXJb3oCp\nRQQSzpGlTULf1TqchxW73e25RqOTG43g/++L5ZFY9SD2Nov1jgUki0rjxUzP\nk6Ke7p/mDIejQWuaNiN2rNK+pqBhjyipicSybE76jLvOQgIhDHcl8vuHorye\nGVbX\r\n=cjr5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+oluu6/lSiWfBzXVl9HdVCTkwKoq55STh4azswPeSsgIhANF5NE6OHEdA9GKLQIVFueXnoJFe12bHQ4cRQf5Xo+an"}]},"maintainers":[{"name":"debox","email":"jcookist@gmail.com"},{"name":"nurdiansyah","email":"nur.diansyah.ckt@gmail.com"}],"_npmUser":{"name":"nurdiansyah","email":"nur.diansyah.ckt@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cpx_1.5.0_1557734155988_0.1924779891842201"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-13T07:55:55.835Z","1.5.0":"2019-05-13T07:55:56.100Z","modified":"2022-04-05T03:32:18.569Z"},"maintainers":[{"email":"nur.diansyah.ckt@gmail.com","name":"nurdiansyah"}],"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"}