{"id":16682571,"url":"https://github.com/jchip/opfs","last_synced_at":"2025-10-23T20:04:08.129Z","repository":{"id":57315720,"uuid":"139189913","full_name":"jchip/opfs","owner":"jchip","description":"yet another node fs wrapper","archived":false,"fork":false,"pushed_at":"2020-04-09T04:21:15.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T23:07:02.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-29T19:53:49.000Z","updated_at":"2024-01-08T02:04:27.000Z","dependencies_parsed_at":"2022-09-18T20:52:39.816Z","dependency_job_id":null,"html_url":"https://github.com/jchip/opfs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fopfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fopfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fopfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fopfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchip","download_url":"https://codeload.github.com/jchip/opfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392326,"owners_count":20283565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T14:07:57.852Z","updated_at":"2025-10-23T20:04:03.091Z","avatar_url":"https://github.com/jchip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n[![Dependency Status][daviddm-image]][daviddm-url] [![devDependency Status][daviddm-dev-image]][daviddm-dev-url]\n\n# opfs\n\nYet another node [fs] wrapper.\n\n- With promisfied methods that still work with callbacks.\n- Set your own custom Promise.\n- Non constructor functions bound to [fs].\n- All other original properties transferred as is.\n- No dependencies.\n- Optional pkgs promisified and added: [mkdirp], [rimraf].\n- Save full caller stack (10-20% performance penalty)\n\n## Install\n\n```bash\nnpm install --save opfs\n```\n\n## Usage\n\n```js\nconst opfs = require(\"opfs\");\n\n// Set custom Promise to bluebird. This is automatic if\n// it's found in your package.json and node_modules.\n\nopfs._opfsSetPromise(require(\"bluebird\"));\n\n// To use native Promise even if bluebird was found.\n\nopfs._opfsSetPromise();\n\n// To turn off save full caller stack\n\nopfs._opfsSaveStack(false);\n\n// promise APIs\n\nopfs\n  .readFile(\"foo.text\")\n  .then(data =\u003e {})\n  .catch(err =\u003e {});\n\n// native promises methods (if available) node 10+\n\nopfs.promises\n  .readFile(\"foo.text\")\n  .then(data =\u003e {})\n  .catch(err =\u003e {});\n\n// callback still works\n\nopfs.readFile(\"foo.text\", (err, data) =\u003e {});\n\n//\n// optional pkgs (if found in your package.json and node_modules)\n//\n\n// mkdirp\nopfs.$.mkdirp(\"a/b/c\").then(() =\u003e {});\nopfs.$.mkdirpSync(\"a/b/c\");\n\n// rimraf\nopfs.$.rimraf(\"a\").then(() =\u003e {});\nopfs.$.rimrafSync(\"a\");\n\n// All other fs props transferred\n\nconsole.log(typeof opfs.Stats);\nconsole.log(typeof opfs.readFileSync);\nconsole.log(typeof opfs.F_OK);\nconsole.log(typeof opfs.W_OK);\n```\n\n# License\n\nCopyright (c) 2018-present, Joel Chen\n\nLicensed under the [Apache License, Version 2.0].\n\n[apache license, version 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[travis-image]: https://travis-ci.org/jchip/opfs.svg?branch=master\n[travis-url]: https://travis-ci.org/jchip/opfs\n[npm-image]: https://badge.fury.io/js/opfs.svg\n[npm-url]: https://npmjs.org/package/opfs\n[daviddm-image]: https://david-dm.org/jchip/opfs/status.svg\n[daviddm-url]: https://david-dm.org/jchip/opfs\n[daviddm-dev-image]: https://david-dm.org/jchip/opfs/dev-status.svg\n[daviddm-dev-url]: https://david-dm.org/jchip/opfs?type=dev\n[fs]: https://nodejs.org/api/fs.html\n[mkdirp]: https://www.npmjs.com/package/mkdirp\n[rimraf]: https://www.npmjs.com/package/rimraf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Fopfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchip%2Fopfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Fopfs/lists"}