{"_id":"fs-mode","_rev":"6-61337a697c2df34b7258de2ccba2b59d","name":"fs-mode","description":"Provides async and sync fs methods with identical APIs","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"fs-mode","version":"1.0.0","description":"Provides async and sync fs methods with identical APIs","main":"index.js","scripts":{"test":"mocha"},"keywords":["fs","mode","async","sync","file"],"author":{"name":"Elan Shanker"},"license":"ISC","dependencies":{"cbify":"^1.0.0"},"devDependencies":{"mocha":"^1.21.4"},"_id":"fs-mode@1.0.0","dist":{"shasum":"b7e6dfe66c31a51f10af5318d4838b90b083e041","tarball":"https://registry.npmjs.org/fs-mode/-/fs-mode-1.0.0.tgz","integrity":"sha512-NbDj/PdmU6PyxbNeN4iX9d2+1tU+XP/6a3Vz83vLbl+PDu/r+KHbryI15jYoghh1150VxDCUFGnYFSOXm1OYWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb8FVRrSBm/R4PPAb5Rhm/LMw0NWMHeGT8brtdh11JawIgUSFypSHbIM8zuGxViwyNOfyBxFEhYfiRVNGsQwEIKQU="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}]},"1.0.1":{"name":"fs-mode","version":"1.0.1","description":"Provides async and sync fs methods with identical APIs","main":"index.js","files":["index.js"],"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/es128/fs-mode"},"keywords":["fs","mode","async","sync","file"],"author":{"name":"Elan Shanker"},"license":"ISC","bugs":{"url":"https://github.com/es128/fs-mode/issues"},"homepage":"https://github.com/es128/fs-mode","dependencies":{"cbify":"^1.0.0"},"devDependencies":{"mocha":"^1.21.4"},"gitHead":"a6da8e6c0d0af1cc2342f46cc869561b815ccc50","_id":"fs-mode@1.0.1","_shasum":"73102f40aa1a25221dda0eaa906616d6da08255a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"dist":{"shasum":"73102f40aa1a25221dda0eaa906616d6da08255a","tarball":"https://registry.npmjs.org/fs-mode/-/fs-mode-1.0.1.tgz","integrity":"sha512-8GIKkfYnETftRTv1vP84XdGtnBoFwrqWLPMus2sXqUcPkvW92wXb/dWSVEAIAymRbjwKoKYZAonuf8KY7c4Pbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE77XupdMi19KOgOw1q00mVFVBPcO15BLyh/whPpodKRAiBb5LeoUWahSuPsrE2/g21CuQF/P/wYy+7gtEEO4ZZ1mg=="}]}}},"readme":"# fs-mode\n\nA drop-in replacement for Node's native `fs` module which adds `fs.Async` and\n`fs.Sync` namespaces with identical method names and APIs. So\n`fs.Async.readFile` is the same as `fs.readFile`, and `fs.Sync.readFile` is a\nwrapped version of `fs.readFileSync` which passes the result to a callback\ninstead of just returning it.\n\n## Installation\n\n`npm install --save fs-mode`\n\n## Usage\n\n```js\nvar fs = require('fs-mode');\n\nfunction myModule (fs, otherArg, callback) {\n\t// normal fs stuff using async methods\n\tfs.readFile('myFile', function (err, data) {\n\t\tif (err) return callback(err);\n\t\tvar result = doSomethingTo(data);\n\t\tcallback(null, result);\n\t});\n}\n\nmodule.exports = {\n\tmyModule: myModule.bind(null, fs.Async),\n\tmyModuleSync: function (otherArg) {\n\t\tvar result;\n\t\tmyModule(fs.Sync, otherArg, function (err, data) {\n\t\t\tif (err) throw err;\n\t\t\tresult = data;\n\t\t});\n\t\treturn result;\n\t}\n}\n```\n\nAs you can see, this makes it pretty easy to adapt an existing async module\nusing fs methods to also provide a sync option. For a real-world example of\nthis type of conversion, see https://github.com/es128/progeny/commit/6685987033036f9c6c1dc5afcc69268221681538\n\n#### Use with other fs replacements\n\nSuch as graceful-fs or fs-extra\n\n```js\nvar fs = require('fs-mode')('graceful-fs');\n```\n\n## License\n\n[ISC](https://raw.github.com/es128/fs-mode/master/LICENSE)\n","maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"time":{"modified":"2022-06-18T03:54:07.854Z","created":"2014-10-01T20:30:01.865Z","1.0.0":"2014-10-01T20:30:01.865Z","1.0.1":"2014-10-02T02:07:20.908Z"},"keywords":["fs","mode","async","sync","file"],"author":{"name":"Elan Shanker"},"license":"ISC","readmeFilename":"README.md","homepage":"https://github.com/es128/fs-mode","repository":{"type":"git","url":"https://github.com/es128/fs-mode"},"bugs":{"url":"https://github.com/es128/fs-mode/issues"}}