{"_id":"@npmcorp/copy","_rev":"97020","name":"@npmcorp/copy","description":"Copy files, directories and links, preserving ownership and perms","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"andrialexandrou","email":"andri.j.alexandrou@gmail.com"},{"name":"anurbol","email":"alpysbayev@mail.ru"},{"name":"ethomson","email":"ethomson@edwardthomson.com"},{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"jar349","email":"jruiz@johnruiz.com"},{"name":"lisayu","email":"lisa@npmjs.com"},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"mangwana","email":"judith@npmjs.com"},{"name":"npm","email":""},{"name":"npm-sre-readonly","email":"ops+npm-sre-readonly@npmjs.com"},{"name":"npm-sre-write","email":"ops+npm-sre-write@npmjs.com"},{"name":"npmci","email":"ops@npmjs.com"},{"name":"robdnpm","email":"rob@npmjs.com"},{"name":"thedave42","email":"dave@digitalnoise.net"},{"name":"trevorsg","email":"trgau@microsoft.com"}],"time":{"modified":"2021-06-03T10:32:33.000Z","created":"2017-02-27T03:38:32.273Z","1.0.0":"2017-02-27T03:38:32.273Z"},"users":{"iarna":true},"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"repository":{"type":"git","url":"git+https://github.com/npm/npmcorp-copy.git"},"versions":{"1.0.0":{"name":"@npmcorp/copy","version":"1.0.0","description":"Copy files, directories and links, preserving ownership and perms","main":"copy.js","scripts":{"test":"standard && tap --coverage test"},"keywords":[],"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"license":"ISC","dependencies":{"aproba":"^1.1.1","fs-write-stream-atomic":"^1.0.8","iferr":"^0.1.5","mkdirp":"^0.5.1","rimraf":"^2.5.4","run-queue":"^1.0.0"},"devDependencies":{"standard":"^8.6.0","tacks":"^1.2.6","tap":"^10.1.1"},"files":["copy.js","is-windows.js"],"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/npm/npmcorp-copy.git"},"bugs":{"url":"https://github.com/npm/npmcorp-copy/issues"},"homepage":"https://www.npmjs.com/package/@npmcorp/copy","gitHead":"731abdc0e3fd2f297e9423620524b6be38c0ef20","_id":"@npmcorp/copy@1.0.0","_shasum":"ffa8003a144c8340858d9d5998895210d1fa1e12","_from":".","_npmVersion":"4.4.0","_nodeVersion":"4.6.1","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"ffa8003a144c8340858d9d5998895210d1fa1e12","size":4547,"noattachment":false,"key":"/@npmcorp/copy/-/@npmcorp/copy-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@npmcorp/copy/download/@npmcorp/copy-1.0.0.tgz"},"maintainers":[{"name":"andrialexandrou","email":"andri.j.alexandrou@gmail.com"},{"name":"anurbol","email":"alpysbayev@mail.ru"},{"name":"ethomson","email":"ethomson@edwardthomson.com"},{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"jar349","email":"jruiz@johnruiz.com"},{"name":"lisayu","email":"lisa@npmjs.com"},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"mangwana","email":"judith@npmjs.com"},{"name":"npm","email":""},{"name":"npm-sre-readonly","email":"ops+npm-sre-readonly@npmjs.com"},{"name":"npm-sre-write","email":"ops+npm-sre-write@npmjs.com"},{"name":"npmci","email":"ops@npmjs.com"},{"name":"robdnpm","email":"rob@npmjs.com"},{"name":"thedave42","email":"dave@digitalnoise.net"},{"name":"trevorsg","email":"trgau@microsoft.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/copy-1.0.0.tgz_1488166712044_0.09934459743089974"},"publish_time":1488166712273,"_cnpm_publish_time":1488166712273,"deprecated":"This module has been renamed to copy-concurrently","_hasShrinkwrap":false}},"readme":"# @npminc/copy\n\nCopy files, directories and symlinks\n\n```\nconst copy = require('@npminc/copy')\ncopy('/path/to/thing', '/new/path/thing').then(() => {\n  // this is now copied\n}).catch(err => {\n  // oh noooo\n})\n```\n\nCopies files, directories and symlinks.  Ownership is maintained when\nrunning as root, permissions are always maintained.  On Windows, if symlinks\nare unavailable then junctions will be used.\n\n## PUBLIC INTERFACE\n\n### copy(from, to, [options]) → Promise\n\nRecursively copies `from` to `to` and resolves its promise when finished. \nIf `to` already exists then the promise will be rejected with an `EEXIST`\nerror.\n\nOptions are:\n\n* maxConcurrency – (Default: `1`) The maximum number of concurrent copies to do at once.\n* recurseWith - (Default: `copy.item`) The function to call on each file after recursing into a directory.\n* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires\n  an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory\n  fails then we'll try making a junction instead.\n\nOptions can also include dependency injection:\n\n* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's.\n* fs - (Default: `require('fs')`) The filesystem module to use.  Can be used\n  to use `graceful-fs` or to inject a mock.\n* writeStreamAtomic - (Default: `require('fs-write-stream-atomic')`) The\n  implementation of `writeStreamAtomic` to use.  Used to inject a mock.\n* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock.\n\n## EXTENSION INTERFACE\n\nOrdinarily you'd only call `copy` above.  But it's possible to use it's\ncomponent functions directly.  This is useful if, say, you're writing\n[@npminc/move](https://npmjs.com/package/@npminc/move). \n\n### copy.file(from, to, options) → Promise\n\nCopies a ordinary file `from` to destination `to`.  Uses\n`fs-write-stream-atomic` to ensure that the file is entirely copied or not\nat all.\n\nOptions are:\n\n* uid, gid - (Optional) If `getuid()` is `0` then this and gid will be used to\n  set the user and group of `to`.  If uid is present then gid must be too.\n* mode - (Optional) If set then `to` will have its perms set to `mode`.\n* fs - (Default: `require('fs')`) The filesystem module to use.  Can be used\n  to use `graceful-fs` or to inject a mock.\n* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's.\n* writeStreamAtomic - (Default `require('fs-write-stream-atomic')`) The\n  implementation of `writeStreamAtomic` to use.  Used to inject a mock.\n\n### copy.symlink(from, to, options) → Promise\n\nCopies a symlink `from` to destination `to`.  If on Windows then if\nsymlinking fails, a junction will be used instead.\n\nOptions are:\n\n* top - The top level the copy is being run from.  This is used to determine\n  if the symlink destination is within the set of files we're copying or\n  outside it.\n* fs - (Default: `require('fs')`) The filesystem module to use.  Can be used\n  to use `graceful-fs` or to inject a mock.\n* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's.\n* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires\n  an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory\n  fails then we'll try making a junction instead.\n\n### copy.recurse(from, to, options) → Promise\n\nReads all of the files in directory `from` and adds them to the `queue`\nusing `recurseWith` (by default `copy.item`).\n\nOptions are:\n\n* queue - A [`run-queue`](https://npmjs.com/package/run-queue) object to add files found inside `from` to.\n* recurseWith - (Default: `copy.item`) The function to call on each file after recursing into a directory.\n* uid, gid - (Optional) If `getuid()` is `0` then this and gid will be used to\n  set the user and group of `to`.  If uid is present then gid must be too.\n* mode - (Optional) If set then `to` will have its perms set to `mode`.\n* fs - (Default: `require('fs')`) The filesystem module to use.  Can be used\n  to use `graceful-fs` or to inject a mock.\n* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock.\n\n### copy.item(from, to, options) → Promise\n\nCopies some kind of `from` to destination `to`.  This looks at the filetype\nand calls `copy.file`, `copy.symlink` or `copy.recurse` as appropriate.\n\nSymlink copies are queued with a priority such that they happen after all\nfile and directory copies as you can't create a junction on windows to a\nfile that doesn't exist yet.\n\nOptions are:\n\n* top - The top level the copy is being run from.  This is used to determine\n  if the symlink destination is within the set of files we're copying or\n  outside it.\n* queue - The [`run-queue`](https://npmjs.com/package/run-queue) object to\n  pass to `copy.recurse` if `from` is a directory.\n* recurseWith - (Default: `copy.item`) The function to call on each file after recursing into a directory.\n* uid, gid - (Optional) If `getuid()` is `0` then this and gid will be used to\n  set the user and group of `to`.  If uid is present then gid must be too.\n* mode - (Optional) If set then `to` will have its perms set to `mode`.\n* fs - (Default: `require('fs')`) The filesystem module to use.  Can be used\n  to use `graceful-fs` or to inject a mock.\n* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock.\n* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires\n  an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory\n  fails then we'll try making a junction instead.\n* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's.\n* writeStreamAtomic - (Default `require('fs-write-stream-atomic')`) The\n  implementation of `writeStreamAtomic` to use.  Used to inject a mock.\n","_attachments":{},"homepage":"https://www.npmjs.com/package/@npmcorp/copy","bugs":{"url":"https://github.com/npm/npmcorp-copy/issues"},"license":"ISC"}