{"analyzedAt":"2022-07-08T01:15:01.011Z","collected":{"metadata":{"name":"multi-fs","scope":"unscoped","version":"1.0.1","description":"A client for doing FS operations in multiple places in sync.","keywords":["fs","redundancy","ssh","scp"],"date":"2017-08-31T15:56:49.567Z","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/","username":"isaacs"},"publisher":{"username":"soldair","email":"soldair@gmail.com"},"maintainers":[{"username":"bcoe","email":"ben@npmjs.com"},{"username":"arobson","email":"asrobson@gmail.com"},{"username":"mmalecki","email":"me@mmalecki.com"},{"username":"soldair","email":"soldair@gmail.com"},{"username":"ceejbot","email":"ceejceej@gmail.com"},{"username":"isaacs","email":"i@izs.me"}],"contributors":[{"name":"C J Silverio","email":"ceejceej@gmail.com"}],"repository":{"type":"git","url":"git://github.com/npm/multi-fs.git"},"links":{"npm":"https://www.npmjs.com/package/multi-fs","homepage":"https://github.com/npm/multi-fs","repository":"https://github.com/npm/multi-fs","bugs":"https://github.com/npm/multi-fs/issues"},"license":"ISC","dependencies":{"once":"~1.3.1","ssh2":"~0.3.6","tmp":"~0.0.24"},"devDependencies":{"mkdirp":"~0.5.0","rimraf":"~2.2.6","standard-version":"^4.2.0","tap":"^1.2.0"},"releases":[{"from":"2022-06-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":1},{"from":"2022-04-09T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":1},{"from":"2022-01-09T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":1},{"from":"2021-07-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":1},{"from":"2020-07-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":1}],"hasTestScript":true,"readme":"# multi-fs\n\nA client for doing FS operations in multiple places in sync.\n\nCurrent supported targets:\n\n1. File system root paths\n2. Remote unix systems (via ssh)\n\nPlanned supported targets:\n\n1. Rackspace Cloud Files\n2. Amazon S3\n\n[![on npm](http://img.shields.io/npm/v/multi-fs.svg?style=flat)](https://www.npmjs.org/package/multi-fs)  [![Dependencies](http://img.shields.io/david/npm/multi-fs.svg?style=flat)](https://david-dm.org/izs/multi-fs)\n\n\n## USAGE\n\n```javascript\nvar MultiFS = require(\"multi-fs\")\nvar client = new MultiFS([\n  // FS is the default type\n  \"/path/to/some/stuff\",\n\n  // ssh urls are desugared\n  \"ssh://user@host:path/in/home\",\n\n  // setting special ssh options requires using\n  // the full object style, though.\n  {\n    type: \"ssh\",\n    host: \"some-host\",\n    user: \"some-user\",\n    identity: \"/home/.ssh/id_rsa_some_key\",\n    path: \"path/in/home\"\n  },\n\n  // you can use a variant of the ssh client that does file\n  // copies by spawning scp. the options are identical to ssh\n  {\n    type: \"scp\",\n    host: \"some-host\",\n    user: \"some-user\",\n    identity: \"/home/.ssh/id_rsa_some_key\",\n    path: \"path/in/home\"\n  },\n  \"scp://user@host:path/in/home\",\n])\n\n// Paths are not allowed to traverse up past the parent.\nclient.readdir(\"foo/bar\", function (er, files) {\n  if (er) {\n    console.log(\"it failed!\")\n  } else {\n    console.log(\"results:\", files)\n  }\n})\n```\n\n## Methods\n\nAll methods take `cb` as their last argument.\n\nReading functions:\n\n* `stat(path, cb)`\n* `readdir(path, cb)`\n* `readFile(path, [encoding], cb)`\n* `md5(path, cb)`\n\nWriting functions:\n\n* `writeFile(path, data, [encoding], cb)`\n* `writeFilep(path, data, [encoding], cb)`\n* `mkdir(path, cb)`\n* `mkdirp(path, cb)`\n* `unlink(path, cb)`\n* `rmdir(path, cb)`\n* `rmr(path, cb)`\n\n### Results\n\nCallbacks are called with the following arguments:\n\n* `error` First error encountered.  If no errors are encountered, but\n  the data returned is not consistent, then it will return an\n  'Inconsistent Data' error.\n* `result`  The result of the operation.  If consistent results are\n  not found, then this will be set to null.\n* `data`  Errors, results, and extra metadata from all hosts.\n\nFor all methods except `readfile`, it performs the operation on all\ntargets, and will raise an `Inconsistent Data` error if they do not\nreturn matching results.\n\nFor `readfile`, it will call `md5` and compare hashes, and then, if\nthe results all match, it will read the actual file from the first\nclient that returned an md5 hash.\n\nCalls to `writeFile` are atomic on all clients.  It will write to a\ntemporary file like `foo.txt.TMP.cafef00d` and then rename to\n`foo.txt` when finished.  If the write fails, it makes a best effort\nattempt to unlink the temporary file.\n\n### Stat Objects\n\nBecause different systems represent file/directory stats differently,\nstat calls return a simple object with only `isFile` and `iDirectory`\nboolean members as the first argument.  The original stat objects from\nthe underlying systems are returned in the `data` argument.\n\n## Streams\n\nI think it'd be great to have `createReadStream(p, cb)` and\n`createWriteStream(p, cb)` methods on the client, especially since all\nthe targets (fs, ssh2, etc.) support streams already.\n\nHowever, especially for readable streams, it's not at all clear how to\nhandle inconsistencies.  Right now, `readFile` will raise an\n`Inconsistent Data` error if two hosts return different stuff.\nHowever, with a readable stream, it'd have to be checking each chunk\nsomehow, and that gets pretty complicated.\n\nProbably that \"check multiple streams and make sure they're all\nproducing the same data\" thing should be a separate module.\n\nFor writable streams, it's a bit easier, since it's just a\nmultiplexing pipe thing, but hasn't been done at this time."},"npm":{"downloads":[{"from":"2022-07-07T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":0},{"from":"2022-07-01T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":1},{"from":"2022-06-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":19},{"from":"2022-04-09T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":145},{"from":"2022-01-09T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":256},{"from":"2021-07-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":704}],"starsCount":1},"github":{"starsCount":14,"forksCount":9,"subscribersCount":31,"issues":{"count":18,"openCount":5,"distribution":{"3600":3,"10800":1,"32400":0,"97200":2,"291600":4,"874800":1,"2624400":1,"7873200":0,"23619600":0,"70858800":1,"212576400":5},"isDisabled":false},"contributors":[{"username":"seldo","commitsCount":1},{"username":"soldair","commitsCount":8},{"username":"isaacs","commitsCount":25},{"username":"bcoe","commitsCount":1},{"username":"mmalecki","commitsCount":3}],"commits":[{"from":"2022-07-01T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":0},{"from":"2022-06-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":0},{"from":"2022-04-09T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":0},{"from":"2022-01-09T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":0},{"from":"2021-07-08T00:00:00.000Z","to":"2022-07-08T00:00:00.000Z","count":0}],"statuses":[{"context":"continuous-integration/travis-ci/push","state":"failure"}]},"source":{"files":{"readmeSize":3773,"testsSize":41557,"hasChangelog":true},"badges":[{"urls":{"original":"http://img.shields.io/npm/v/multi-fs.svg?style=flat","shields":"https://img.shields.io/npm/v/multi-fs.svg","content":"https://img.shields.io/npm/v/multi-fs.json"},"info":{"service":"npm","type":"version","modifiers":{"type":"v"}}},{"urls":{"original":"http://img.shields.io/david/npm/multi-fs.svg?style=flat","service":"https://david-dm.org/npm/multi-fs.svg","shields":"https://img.shields.io/david/npm/multi-fs.svg","content":"https://img.shields.io/david/npm/multi-fs.json"},"info":{"service":"david","type":"dependencies","modifiers":{"statusType":"normal"}}}],"outdatedDependencies":{"once":{"required":"~1.3.1","stable":"1.4.0","latest":"1.4.0"},"tmp":{"required":"~0.0.24","stable":"0.2.1","latest":"0.2.1"},"ssh2":{"required":"~0.3.6","stable":"1.11.0","latest":"1.11.0"}}}},"evaluation":{"quality":{"carefulness":0.7899999999999999,"tests":0.6,"health":0.5,"branding":0.3},"popularity":{"communityInterest":60,"downloadsCount":48.333333333333336,"downloadsAcceleration":-0.45049467275494676,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6329276052637631,"detail":{"quality":0.8558109731398994,"popularity":0.07493148981888363,"maintenance":0.9998808339576686}}}