{"_id":"fs-web","_rev":"6-847e897bba62c24192c4bef2f7c38f78","name":"fs-web","description":"Node's fs, for the browser","dist-tags":{"latest":"1.0.1"},"versions":{"0.8.0":{"name":"fs-web","version":"0.8.0","description":"Node's fs, for the browser","main":"dist/cjs/fs.js","directories":{"test":"test"},"scripts":{"build":"node build.js","test":"testee test/index.html --browsers firefox --reporter Spec"},"repository":{"type":"git","url":"git+https://github.com/matthewp/fs.git"},"keywords":["fs","web"],"author":{"name":"Matthew Phillips"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/matthewp/fs/issues"},"homepage":"https://github.com/matthewp/fs#readme","devDependencies":{"chai":"^3.4.1","steal":"^0.12.7","steal-mocha":"0.0.3","steal-tools":"^0.12.3","testee":"^0.2.2"},"dependencies":{"path":"git://github.com/component/path.git#7b4f23c38833a5232cd5e3d50ccb8cd13dbcd2f4"},"system":{"main":"fs","directories":{"lib":"lib"},"map":{"chai":"chai/chai"},"transpiler":"babel"},"gitHead":"e96b10c943330364b496c69131f89b0f81612d27","_id":"fs-web@0.8.0","_shasum":"59d8dc07b4a784a36c4775c274be0c4eb99ab2d8","_from":".","_npmVersion":"2.14.9","_nodeVersion":"0.12.7","_npmUser":{"name":"matthewp","email":"matthew@matthewphillips.info"},"maintainers":[{"name":"matthewp","email":"matthew@matthewphillips.info"}],"dist":{"shasum":"59d8dc07b4a784a36c4775c274be0c4eb99ab2d8","tarball":"https://registry.npmjs.org/fs-web/-/fs-web-0.8.0.tgz","integrity":"sha512-/92k8fX7v5EM5vlpa6Jb+Z4QIAPe4QxcQhIspqdA2ykWJU/A9KdqGogfT7dDss/r+qxn1365OxMLvzU82CvKWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgygzXXoUp1k7h3jGQe5W3cPZTlgNPbH+nepCOPYSAswIgP8visYXFuuDY4kq2jKPG5vdT+72O5u4QNxiYq+vY6Hc="}]}},"0.8.1":{"name":"fs-web","version":"0.8.1","description":"Node's fs, for the browser","main":"dist/cjs/fs.js","directories":{"test":"test"},"scripts":{"build":"node build.js","test":"testee test/index.html --browsers firefox --reporter Spec"},"repository":{"type":"git","url":"git+https://github.com/matthewp/fs.git"},"keywords":["fs","web"],"author":{"name":"Matthew Phillips"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/matthewp/fs/issues"},"homepage":"https://github.com/matthewp/fs#readme","devDependencies":{"chai":"^3.4.1","steal":"^0.12.7","steal-mocha":"0.0.3","steal-tools":"^0.12.3","testee":"^0.2.2"},"dependencies":{"path":"git://github.com/component/path.git#7b4f23c38833a5232cd5e3d50ccb8cd13dbcd2f4"},"system":{"main":"fs","directories":{"lib":"lib"},"map":{"chai":"chai/chai"},"transpiler":"babel"},"gitHead":"bb6a83057beced65e8d3576b8930111bea90e709","_id":"fs-web@0.8.1","_shasum":"5f3bd19113f092f1efe23414dc83419a32ddc9e8","_from":".","_npmVersion":"2.14.9","_nodeVersion":"0.12.7","_npmUser":{"name":"matthewp","email":"matthew@matthewphillips.info"},"maintainers":[{"name":"matthewp","email":"matthew@matthewphillips.info"}],"dist":{"shasum":"5f3bd19113f092f1efe23414dc83419a32ddc9e8","tarball":"https://registry.npmjs.org/fs-web/-/fs-web-0.8.1.tgz","integrity":"sha512-YvMG8FT1hLftO6HsTAO91VGnWxz5bSodaQvXbJIXD5ADQeBqVebgOJKSf96ZXvJnuoX683pNWiMWgpaRsfPydg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBDoZdMo/F34PW+rLv8uHcx3xwEjcsSvMfrxtoRBF+MOAiBr9ezagtlOAYSp+7tT2Nfy3Vyv0j9yHxYaAV2oshpYeQ=="}]}},"1.0.0":{"name":"fs-web","version":"1.0.0","description":"Node's fs, for the browser","main":"dist/cjs/fs.js","directories":{"test":"test"},"scripts":{"build":"node build.js","test":"DEBUG=testee:* testee test/index.html --browsers firefox --reporter Spec"},"repository":{"type":"git","url":"git+https://github.com/matthewp/fs.git"},"keywords":["fs","web"],"author":{"name":"Matthew Phillips"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/matthewp/fs/issues"},"homepage":"https://github.com/matthewp/fs#readme","devDependencies":{"chai":"^3.4.1","steal":"^0.12.7","steal-mocha":"0.0.3","steal-tools":"^0.12.3","testee":"^0.2.2"},"dependencies":{"path":"git://github.com/component/path.git#7b4f23c38833a5232cd5e3d50ccb8cd13dbcd2f4"},"system":{"main":"fs","directories":{"lib":"lib"},"map":{"chai":"chai/chai"},"transpiler":"babel"},"gitHead":"a2dc3edc60a40613afbf1987e24bfc23f63e90e1","_id":"fs-web@1.0.0","_shasum":"5f1fba6e27366ad62f26a9372fcc5de61fb6fe69","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"matthewp","email":"matthew@matthewphillips.info"},"maintainers":[{"name":"matthewp","email":"matthew@matthewphillips.info"}],"dist":{"shasum":"5f1fba6e27366ad62f26a9372fcc5de61fb6fe69","tarball":"https://registry.npmjs.org/fs-web/-/fs-web-1.0.0.tgz","integrity":"sha512-37o2s74r3oMe8gLejAdVoHTxljY/i9gZ+122DE5Nj7Yb4DvttNl55abjkh6X7yUFsNQ0tZjkv3RdzCMm8OxUNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFEL40nCBppQQWaiva8Ke6wXXLIO+KqDBIwu55a00ljmAiEAsI6w9g8XUNeRkqPbQyx6edNe4x1NpenSd2QvPNSDG1o="}]}},"1.0.1":{"name":"fs-web","version":"1.0.1","description":"Node's fs, for the browser","main":"dist/cjs/fs.js","directories":{"test":"test"},"scripts":{"build":"node build.js","test":"DEBUG=testee:* testee test/index.html --browsers firefox --reporter Spec"},"repository":{"type":"git","url":"git+https://github.com/matthewp/fs.git"},"keywords":["fs","web"],"author":{"name":"Matthew Phillips"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/matthewp/fs/issues"},"homepage":"https://github.com/matthewp/fs#readme","devDependencies":{"chai":"^3.4.1","steal":"^0.12.7","steal-mocha":"0.0.3","steal-tools":"^0.12.3","testee":"^0.2.2"},"dependencies":{"path":"git://github.com/component/path.git#7b4f23c38833a5232cd5e3d50ccb8cd13dbcd2f4"},"system":{"main":"fs","directories":{"lib":"lib"},"map":{"chai":"chai/chai"},"transpiler":"babel"},"gitHead":"7d6003fa9e846fdf38d3bac040dfc22cc3379487","_id":"fs-web@1.0.1","_shasum":"5317e717af94db1687da82a48fc6ee4f808b121b","_from":".","_npmVersion":"3.4.1","_nodeVersion":"5.3.0","_npmUser":{"name":"matthewp","email":"matthew@matthewphillips.info"},"maintainers":[{"name":"matthewp","email":"matthew@matthewphillips.info"}],"dist":{"shasum":"5317e717af94db1687da82a48fc6ee4f808b121b","tarball":"https://registry.npmjs.org/fs-web/-/fs-web-1.0.1.tgz","integrity":"sha512-PUVyPo4SUkGGF3IxFAlzFMCsBi9g9tiRaruN7Bqqy/JHGxCPcX9FiW3w9EnQSG5j/vy3aG+vXJWxaxY2SI4wig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbsKt27IZ3wbgSV3jHr5Nx2Vl0DGQnjGfnTNTGMwsejAiA5fbarO3FPI43q8+crojfiDfx8eYCsTYYqIg2obSJwGg=="}]}}},"readme":"# fs-web\n\nBringing a file system abstraction to the browser. **fs** is a module that allows you to store data in the (modern) browser using an API similar to that of Node's [fs module](http://nodejs.org/api/fs.html)\n\nImplemented in a cross-browser fashion, using [IndexedDB](http://www.w3.org/TR/IndexedDB/).\n\n## Installation\n\nInstall via npm:\n\n```shell\nnpm install fs-web --save\n```\n\n## Example\n\nWriting from a file input.\n\n```javascript\nimport { writeFile } from 'fs-web';\n\nlet input = document.querySelector('input[type=\"file\"]'); \ninput.addEventListener('change', function(e) {\n  let file = this.files[0]; // file is a File object.\n\n  writeFile(file.name, file).then(function() {\n    // All done! File has been saved.\n  });\n});\n```\n\nWriting and reading.\n\n```js\nimport * as fs from 'fs-web';\n\nfs.writeFile('foo/some-file.txt', 'foo')\n  .then(function(){\n    return fs.readdir('foo');\n  })\n  .then(function(files){\n    files // -> [ {some-file.txt} ]\n  });\n```\n\n## API\n\nAll methods return a Promise.\n\n### fs.writeFile(fileName, data)\n\nSaves the file ``data`` with the name ``fileName`` and returns a Promise. If an error is encountered, the Promise will be rejected with an ``Error`` object.\n\n### fs.readFile(fileName)\n\nRetrieves the file with the name ``fileName`` and returns a Promise. The Promise will resolve with the file's data as an ``ArrayBuffer``.\n\n### fs.readString(fileName)\n\nRetrieves the file with the name ``fileName`` and returns a Promise. The Promise will resolve with a string representation of `fileName`.\n\n### fs.removeFile(fileName)\n\nRemoves the file with the name ``fileName`` from storage and returns a Promise. The Promise will resolve even if the fileName doesn't exist.\n\n### fs.readdir(fullPath)\n\nGets the contents of ``fullPath`` and returns a Promise. The Promise will resolve with an array of ``DirectoryEntry`` objects (see below).\n\n### fs.mkdir(fullPath)\n\nCreates a directory at ``fullPath`` and returns a Promise.\n\n### fs.rmdir(fullPath)\n\nRemoves the directory at ``fullPath``, recursively removing any files/subdirectories contained within. Returns a Promise that will resolve when the fullPath is removed.\n\n### DirectoryEntry\n\nA ``DirectoryEntry`` object is resolved from ``fs.readdir`` and represents either a **file** or a **directory**. A DirectoryEntry instance contains these properties/methods:\n\n### DirectoryEntry#path\n\nThe ``path`` property is the full path (including file name) for the given file/directory entry.\n\n### DirectoryEntry#name\n\nThe ``name`` of the given entry, either the file or directory name.\n\n### DirectoryEntry#dir\n\nThe given directory that the file/directory sits in.\n\n### DirectoryEntry#type\n\nThe ``type`` of the entry, either **file** or **directory**.\n\n### DirectoryEntry#readFile()\n\nA convenience method for calling ``readFile(fileName)``. Throws a TypeError if the entry is not of ``type`` **file**.\n\n## License\n\nBSD 2 Clause\n","maintainers":[{"name":"matthewp","email":"matthew@matthewphillips.info"}],"time":{"modified":"2022-06-18T03:56:25.873Z","created":"2015-11-30T04:18:22.589Z","0.8.0":"2015-11-30T04:18:22.589Z","0.8.1":"2015-11-30T04:20:19.350Z","1.0.0":"2015-12-02T00:35:23.044Z","1.0.1":"2016-01-27T16:53:07.966Z"},"homepage":"https://github.com/matthewp/fs#readme","keywords":["fs","web"],"repository":{"type":"git","url":"git+https://github.com/matthewp/fs.git"},"author":{"name":"Matthew Phillips"},"bugs":{"url":"https://github.com/matthewp/fs/issues"},"license":"BSD-2-Clause","readmeFilename":"README.md"}