{"_id":"fs-updater","_rev":"8-eb124e67cbf2b90965aa2fddbd587f26","name":"fs-updater","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"fs-updater","description":"Incrementally update a directory based on an in-memory representation.","version":"1.0.0","author":{"name":"Jo Liss","email":"joliss42@gmail.com"},"main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/broccolijs/node-fs-updater.git"},"keywords":["fs"],"files":["index.js"],"dependencies":{"can-symlink":"^1.0.0","clean-up-path":"^1.0.0","heimdalljs":"^0.2.5","heimdalljs-logger":"^0.1.9","rimraf":"^2.4.3"},"devDependencies":{"chai":"^3.4.0","fixturify":"^0.3.4","mocha":"^2.3.3","mocha-eslint":"^3.0.1"},"scripts":{"test":"mocha","test:debug":"mocha debug"},"gitHead":"24db9073632bf459ebc88a94a9443a123e4f8a1f","bugs":{"url":"https://github.com/broccolijs/node-fs-updater/issues"},"homepage":"https://github.com/broccolijs/node-fs-updater#readme","_id":"fs-updater@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"joliss","email":"joliss42@gmail.com"},"dist":{"integrity":"sha512-25O5jOiZ1FAPX9ZAVBeUpodmAu2se0sECqs4x6xD4Y2Zz5UR7FFR5KTjlq0QFswUGBEvMy8ZjFCvZM3B8jzzWw==","shasum":"f61d8cbbc3a7efe07497914e6c9e6287cbe72884","tarball":"https://registry.npmjs.org/fs-updater/-/fs-updater-1.0.0.tgz","fileCount":5,"unpackedSize":10961,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASgerVYcxRzhUeye1NLyaN8yGBE0tQGnW9Vr7ust7HVAiEAodPmi+/pTA8kezruto8ux44Y/6G0ryJ/gWW36gtj02g="}]},"maintainers":[{"name":"joliss","email":"joliss42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-updater_1.0.0_1518714585879_0.6028054057450893"},"_hasShrinkwrap":false},"1.0.1":{"name":"fs-updater","description":"Incrementally update a directory based on an in-memory representation.","version":"1.0.1","author":{"name":"Jo Liss","email":"joliss42@gmail.com"},"main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/broccolijs/node-fs-updater.git"},"keywords":["fs"],"files":["index.js"],"dependencies":{"can-symlink":"^1.0.0","clean-up-path":"^1.0.0","heimdalljs":"^0.2.5","heimdalljs-logger":"^0.1.9","rimraf":"^2.4.3"},"devDependencies":{"chai":"^3.4.0","fixturify":"^0.3.4","mocha":"^2.3.3","mocha-eslint":"^3.0.1"},"scripts":{"test":"mocha","test:debug":"mocha debug"},"gitHead":"70e7d6807089a6d8840aea77c3bec4306ced58f4","bugs":{"url":"https://github.com/broccolijs/node-fs-updater/issues"},"homepage":"https://github.com/broccolijs/node-fs-updater#readme","_id":"fs-updater@1.0.1","_shasum":"6d58b22b46416a4a87da63632fda5d8cf6abc45a","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"joliss","email":"joliss42@gmail.com"},"dist":{"shasum":"6d58b22b46416a4a87da63632fda5d8cf6abc45a","tarball":"https://registry.npmjs.org/fs-updater/-/fs-updater-1.0.1.tgz","fileCount":4,"unpackedSize":8102,"integrity":"sha512-coFqnxorxeRot53Pih7JVSw+IPOYSKpKQYTHr7HacKCaDUpUpAqRtKtnq4cPGqvDDtTWC17F6763xpl1omoJZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBd22J6QrO6jHyqpO3WEe8oOLw1rnaSWZsueBR1/KxMAIhAJRyBfEf5JpOL8CfrD5XndbPuAi921FL/y59ed6+TBFf"}]},"maintainers":[{"name":"joliss","email":"joliss42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-updater_1.0.1_1518716862601_0.0734800371502784"},"_hasShrinkwrap":false},"1.0.2":{"name":"fs-updater","description":"Incrementally update a directory based on an in-memory representation.","version":"1.0.2","author":{"name":"Jo Liss","email":"joliss42@gmail.com"},"main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/broccolijs/node-fs-updater.git"},"keywords":["fs"],"files":["index.js"],"dependencies":{"can-symlink":"^1.0.0","clean-up-path":"^1.0.0","heimdalljs":"^0.2.5","heimdalljs-logger":"^0.1.9","rimraf":"^2.4.3"},"devDependencies":{"chai":"^3.4.0","fixturify":"^0.3.4","mocha":"^2.3.3","mocha-eslint":"^3.0.1"},"scripts":{"test":"mocha","test:debug":"mocha debug"},"gitHead":"d37681a00226d69d0ea27aa789e749f216dc2541","bugs":{"url":"https://github.com/broccolijs/node-fs-updater/issues"},"homepage":"https://github.com/broccolijs/node-fs-updater#readme","_id":"fs-updater@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"joliss","email":"joliss42@gmail.com"},"dist":{"integrity":"sha512-ag3Ve97ue8t9uTzy/5tps11TqZGeMX0PCrDjlC/1XDBbIex6SdihkKSJDqqbIgt28DMYImrzXMoU664FU+VxjA==","shasum":"8e31cc8aaab614b3f9e6e1a7264e79bfe30ac50d","tarball":"https://registry.npmjs.org/fs-updater/-/fs-updater-1.0.2.tgz","fileCount":5,"unpackedSize":11491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyxjw9t8GTcus+eDuw1mgG9N+mMNaclyqRxCWIx1pMJgIgJfUnumdCEpXRK7lQB5IWc/R4rradQC65Bio1TrkuNkA="}]},"maintainers":[{"name":"joliss","email":"joliss42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-updater_1.0.2_1518936550568_0.8133348071417856"},"_hasShrinkwrap":false},"1.0.3":{"name":"fs-updater","description":"Incrementally update a directory based on an in-memory representation.","version":"1.0.3","author":{"name":"Jo Liss","email":"joliss42@gmail.com"},"main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/broccolijs/node-fs-updater.git"},"keywords":["fs"],"files":["index.js"],"dependencies":{"can-symlink":"^1.0.0","clean-up-path":"^1.0.0","heimdalljs":"^0.2.5","heimdalljs-logger":"^0.1.9","rimraf":"^2.4.3"},"devDependencies":{"chai":"^3.4.0","fixturify":"^0.3.4","mocha":"^2.3.3","mocha-eslint":"^3.0.1"},"scripts":{"test":"mocha","test:debug":"mocha debug"},"gitHead":"eb27e0e0c9f7365d8a644aaf9362eee81e3353ba","bugs":{"url":"https://github.com/broccolijs/node-fs-updater/issues"},"homepage":"https://github.com/broccolijs/node-fs-updater#readme","_id":"fs-updater@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"joliss","email":"joliss42@gmail.com"},"dist":{"integrity":"sha512-K4zqsoqrXs2PGn/MlxGik2XVcYY0my3iL/t57QDS33unSQl1G0xjeHS2ZTW/+9FO5OZpvddN99npKdWpOUoTZQ==","shasum":"26ee5aedd102c90011ce16f85cfc51599f6169e9","tarball":"https://registry.npmjs.org/fs-updater/-/fs-updater-1.0.3.tgz","fileCount":5,"unpackedSize":14730,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzgwIwdHoaLUTHmrJ7+dbpx1w4IuWPkjPn7rABU5Ck3AiEAuuMka9PHR577V2CD0ZXwkyVBoR0vMY2nQH6S5FuSfaQ="}]},"maintainers":[{"name":"joliss","email":"joliss42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-updater_1.0.3_1519055856251_0.01985131079091995"},"_hasShrinkwrap":false},"1.0.4":{"name":"fs-updater","description":"Incrementally update a directory based on an in-memory representation.","version":"1.0.4","author":{"name":"Jo Liss","email":"joliss42@gmail.com"},"main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/broccolijs/node-fs-updater.git"},"keywords":["fs"],"files":["index.js"],"engines":{"node":">=6.0.0"},"dependencies":{"can-symlink":"^1.0.0","clean-up-path":"^1.0.0","heimdalljs":"^0.2.5","heimdalljs-logger":"^0.1.9","rimraf":"^2.6.2"},"devDependencies":{"chai":"^4.1.2","fixturify":"^0.3.4","mocha":"^5.0.1","mocha-eslint":"^4.1.0"},"scripts":{"test":"mocha","test:debug":"mocha debug"},"gitHead":"3970467908281bc93d59aff9b566f30d99b752f2","bugs":{"url":"https://github.com/broccolijs/node-fs-updater/issues"},"homepage":"https://github.com/broccolijs/node-fs-updater#readme","_id":"fs-updater@1.0.4","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"joliss","email":"joliss42@gmail.com"},"dist":{"integrity":"sha512-0pJX4mJF/qLsNEwTct8CdnnRdagfb+LmjRPJ8sO+nCnAZLW0cTmz4rTgU25n+RvTuWSITiLKrGVJceJPBIPlKg==","shasum":"2329980f99ae9176e9a0e84f7637538a182ce63b","tarball":"https://registry.npmjs.org/fs-updater/-/fs-updater-1.0.4.tgz","fileCount":5,"unpackedSize":14804,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEEukDXtx0M6lQx8G22YzOF96M6V/lt9blb0NVqaTdwgIhANJOjqI/m1IZHoS3/ffjvU3NmMipEUoHYC6vJg3AxaoN"}]},"maintainers":[{"name":"joliss","email":"joliss42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-updater_1.0.4_1519087904627_0.9236901027530138"},"_hasShrinkwrap":false}},"time":{"created":"2018-02-15T17:09:45.878Z","1.0.0":"2018-02-15T17:09:46.524Z","modified":"2022-06-18T03:56:10.875Z","1.0.1":"2018-02-15T17:47:43.294Z","1.0.2":"2018-02-18T06:49:10.634Z","1.0.3":"2018-02-19T15:57:36.308Z","1.0.4":"2018-02-20T00:51:44.679Z"},"maintainers":[{"name":"joliss","email":"joliss42@gmail.com"}],"description":"Incrementally update a directory based on an in-memory representation.","homepage":"https://github.com/broccolijs/node-fs-updater#readme","keywords":["fs"],"repository":{"type":"git","url":"git+https://github.com/broccolijs/node-fs-updater.git"},"author":{"name":"Jo Liss","email":"joliss42@gmail.com"},"bugs":{"url":"https://github.com/broccolijs/node-fs-updater/issues"},"license":"MIT","readme":"# node-fs-updater\n\n[![Build Status](https://travis-ci.org/broccolijs/node-fs-updater.svg?branch=master)](https://travis-ci.org/broccolijs/node-fs-updater)\n[![Build status](https://ci.appveyor.com/api/projects/status/5sb039bjee4q3obw?svg=true)](https://ci.appveyor.com/project/joliss/node-fs-updater)\n\n\nRepeatedly write an in-memory directory tree to disk, with incremental updating.\n\n## Installation\n\nThis package requires Node version 6.0.0 or newer.\n\n```bash\nnpm install --save fs-updater\n```\n\n## Usage\n\n```js\nlet FSUpdater = require(\"fs-updater\");\nlet { File, Directory, DirectoryIndex } = FSUpdater;\n\n// output_dir must either be an empty directory or not exist at all\nlet fsUpdater = new FSUpdater('./output_dir')\n```\n\nLet's create the following directory structure, where `->` indicates a symlink\n(or a copy on Windows):\n\n```\noutput_dir\n├── file -> /path/to/some/file\n├── dir1/ -> /path/to/some/dir\n└── dir2/\n    └── another_file -> /path/to/another/file\n```\n\n```js\nlet dir = new DirectoryIndex([\n  ['file', new File('/path/to/some/file')],\n  ['dir1', new Directory('/path/to/some/dir')],\n  ['dir2', new DirectoryIndex([\n    ['another_file', new File('/path/to/another/file')]\n  ])]\n]);\n\n// Write it to ./output_dir\nfsUpdater.update(dir);\n```\n\nNow let's create an updated similar directory structure:\n\n```\n.\n├── file -> /path/to/some/file\n└── dir1/ -> /path/to/some/dir\n```\n\n```js\ndir = new DirectoryIndex([\n  ['file', new File('/path/to/some/file')],\n  ['dir1', new Directory('/path/to/some/dir')]\n]);\n\n// Now update output_dir incrementally\nfsUpdater.update(dir);\n```\n\n### Object re-use\n\nIt is recommended that you rebuild all your `File`, `Directory` and\n`DirectoryIndex` objects from scratch each time you call `fsUpdater.update`. If\nyou re-use objects, the following rules apply:\n\nFirst, do not mutate the objects that you pass into `FSUpdater`, or their\nsub-objects. That is, after calling `fsUpdater.update(dir)`, you must no longer\ncall `dir.set(...)`.\n\nSecond, you may re-use unchanged `File`, `Directory` and `DirectoryIndex`\nobjects *only* if you know that the file contents they point to *recursively*\nhave not changed. This is typically only the case if they point into directories\nthat you control, and if those directories in turn contain no symlinks to\noutside directories under the user's control.\n\nFor example, this is always OK:\n\n```js\nlet file = new String('/the/file');\nfsUpdater.update(new DirectoryIndex([\n  ['file', file]\n]);\n\n// Create new File object with identical path\nfile = new String('/the/file');\nfsUpdater.update(new DirectoryIndex([\n  ['file', file]\n]);\n```\n\nBut this is only OK if the contents of `/the/file` have not changed between\ncalls to `.update`:\n\n```js\nlet file = new String('/the/file');\nfsUpdater.update(new DirectoryIndex([\n  ['file', file]\n]);\n\n// Re-use the File object\nfsUpdater.update(new DirectoryIndex([\n  ['file', file]\n]);\n```\n\n## Reference\n\n* `FSUpdater`: An object used to repeatedly update an output directory.\n\n  * `new FSUpdater(outputPath, options)`: Create a new `FSUpdater` object. The\n    `outputPath` must be an empty directory or absent.\n\n    It is important that the `FSUpdater` has exclusive access to the\n    `outputPath` directory. `FSUpdater.prototype.update` calls\n    [rimraf](https://github.com/isaacs/rimraf), which can be dangerous in the\n    presence of symlinks if unexpected changes have been made to the\n    `outputPath` directory.\n\n    `options.canSymlink` (boolean): If true, use symlinks; if false, copy\n    files and use junctions. If `null` (default), auto-detect.\n\n  * `FSUpdater.prototype.update(directory)`: Update the `outputPath` directory\n    to mirror the contents of the `directory` object, which is either a\n    `DirectoryIndex` (an in-memory directory) or a `Directory` (a directory on\n    disk).\n\n    **Important note:** You may re-use `File` objects contained in the\n    `DirectoryIndex` between repeated calls to `.update()` only if the file\n    contents have not changed. Similarly, you may re-use `DirectoryIndex` and\n    `Directory` objects only if no changes have been made to the directory or\n    any files or subdirectories recursively, including those reachable through\n    symlinks.\n\n* `FSUpdater.DirectoryIndex`: A subclass of\n  [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)\n  representing an in-memory directory; see the documentation there.\n\n  `DirectoryIndex` objects map file names (`string` primitives, without paths)\n  to `DirectoryIndex`, `Directory` or `File` objects.\n\n* `FSUpdater.Directory`: A directory on disk. Think of this as an in-memory\n  symlink to a directory.\n\n  * `new Directory(path)`: Create a new `Directory` object pointing to\n    the directory at `path`.\n\n  * `Directory.prototype.valueOf()`: Return the `path`.\n\n  * `Directory.prototype.getIndexSync()`: Read the physical directory and return a\n    `DirectoryIndex`. The `DirectoryIndex` object is cached between repeated\n    calls to `getIndexSync()`.\n\n* `FSUpdater.File`: Represents a file on disk. Think of this as an in-memory\n  symlink.\n\n  * `new File(path)`: Create a new `File` object pointing to the file at `path`.\n\n  * `File.prototype.valueOf()`: Return the `path`.\n\n* `FSUpdater.makeFSObject(path)`: Return a `File` or `Directory` object,\n  depending on the file type on disk. This function follows symlinks.\n\n## Contributing\n\nClone this repo and run the tests like so:\n\n```\nnpm install\nnpm test\n```\n\nIssues and pull requests are welcome. If you change code, be sure to re-run\n`npm test`. Oftentimes it's useful to add or update tests as well.\n","readmeFilename":"README.md"}