{"id":23882039,"url":"https://github.com/bevry/safefs","last_synced_at":"2025-08-20T15:49:26.737Z","repository":{"id":7684161,"uuid":"9047388","full_name":"bevry/safefs","owner":"bevry","description":"Deprecated. Use the @bevry/fs-* packages instead","archived":false,"fork":false,"pushed_at":"2024-01-02T04:27:16.000Z","size":1377,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T00:55:57.846Z","etag":null,"topics":["filesystem","nodejs"],"latest_commit_sha":null,"homepage":"https://github.com/orgs/bevry/repositories?language=\u0026q=fs-\u0026sort=\u0026type=all","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/bevry.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["balupton"],"patreon":"bevry","open_collective":"bevry","ko_fi":"balupton","liberapay":"bevry","tidelift":"npm/safefs","custom":["https://bevry.me/fund"]}},"created_at":"2013-03-27T05:37:41.000Z","updated_at":"2024-01-03T22:13:32.000Z","dependencies_parsed_at":"2023-01-13T14:27:55.640Z","dependency_job_id":"74fbc43f-d845-4c9c-b37e-d755fe1b927d","html_url":"https://github.com/bevry/safefs","commit_stats":{"total_commits":253,"total_committers":7,"mean_commits":"36.142857142857146","dds":0.1541501976284585,"last_synced_commit":"613c6d0e59a478223a12aebafd1863c414026a48"},"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fsafefs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fsafefs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fsafefs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fsafefs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bevry","download_url":"https://codeload.github.com/bevry/safefs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615385,"owners_count":20967184,"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":["filesystem","nodejs"],"created_at":"2025-01-04T02:37:11.080Z","updated_at":"2025-04-09T21:34:23.200Z","avatar_url":"https://github.com/bevry.png","language":"JavaScript","funding_links":["https://github.com/sponsors/balupton","https://patreon.com/bevry","https://opencollective.com/bevry","https://ko-fi.com/balupton","https://liberapay.com/bevry","https://tidelift.com/funding/github/npm/safefs","https://bevry.me/fund","https://thanks.dev/u/gh/bevry","https://buymeacoffee.com/balupton","https://opencollective.com/chad8"],"categories":[],"sub_categories":[],"readme":"\u003c!-- TITLE/ --\u003e\n\n# Safe FS\n\n\u003c!-- /TITLE --\u003e\n\n\u003c!-- BADGES/ --\u003e\n\n\u003cspan class=\"badge-githubworkflow\"\u003e\u003ca href=\"https://github.com/bevry/safefs/actions?query=workflow%3Abevry\" title=\"View the status of this project's GitHub Workflow: bevry\"\u003e\u003cimg src=\"https://github.com/bevry/safefs/workflows/bevry/badge.svg\" alt=\"Status of the GitHub Workflow: bevry\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmversion\"\u003e\u003ca href=\"https://npmjs.org/package/safefs\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/safefs.svg\" alt=\"NPM version\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmdownloads\"\u003e\u003ca href=\"https://npmjs.org/package/safefs\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/safefs.svg\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\u003cspan class=\"badge-githubsponsors\"\u003e\u003ca href=\"https://github.com/sponsors/balupton\" title=\"Donate to this project using GitHub Sponsors\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-donate-yellow.svg\" alt=\"GitHub Sponsors donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-thanksdev\"\u003e\u003ca href=\"https://thanks.dev/u/gh/bevry\" title=\"Donate to this project using ThanksDev\"\u003e\u003cimg src=\"https://img.shields.io/badge/thanksdev-donate-yellow.svg\" alt=\"ThanksDev donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/bevry\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-liberapay\"\u003e\u003ca href=\"https://liberapay.com/bevry\" title=\"Donate to this project using Liberapay\"\u003e\u003cimg src=\"https://img.shields.io/badge/liberapay-donate-yellow.svg\" alt=\"Liberapay donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-buymeacoffee\"\u003e\u003ca href=\"https://buymeacoffee.com/balupton\" title=\"Donate to this project using Buy Me A Coffee\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg\" alt=\"Buy Me A Coffee donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-opencollective\"\u003e\u003ca href=\"https://opencollective.com/bevry\" title=\"Donate to this project using Open Collective\"\u003e\u003cimg src=\"https://img.shields.io/badge/open%20collective-donate-yellow.svg\" alt=\"Open Collective donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-crypto\"\u003e\u003ca href=\"https://bevry.me/crypto\" title=\"Donate to this project using Cryptocurrency\"\u003e\u003cimg src=\"https://img.shields.io/badge/crypto-donate-yellow.svg\" alt=\"crypto donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\u003cspan class=\"badge-discord\"\u003e\u003ca href=\"https://discord.gg/nQuXddV7VP\" title=\"Join this project's community on Discord\"\u003e\u003cimg src=\"https://img.shields.io/discord/1147436445783560193?logo=discord\u0026amp;label=discord\" alt=\"Discord server badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-twitch\"\u003e\u003ca href=\"https://www.twitch.tv/balupton\" title=\"Join this project's community on Twitch\"\u003e\u003cimg src=\"https://img.shields.io/twitch/status/balupton?logo=twitch\" alt=\"Twitch community badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n\u003c!-- /BADGES --\u003e\n\n\u003c!-- DESCRIPTION/ --\u003e\n\nStop getting EMFILE errors! Open only as many files as the operating system supports.\n\n\u003c!-- /DESCRIPTION --\u003e\n\n\n## Usage\n\n[Complete API Documentation.](http://master.safefs.bevry.surge.sh/docs/)\n\n```javascript\nvar safefs = require('safefs')\n```\n\nSafeFS uses [graceful-fs](https://npmjs.org/package/graceful-fs) to wrap all of the standard [file system](http://nodejs.org/docs/latest/api/all.html#all_file_system) methods to avoid EMFILE errors among other problems.\n\nOn-top of graceful-fs, SafeFS also adds additional wrapping on the following methods:\n\n-   `writeFile(path, data, options?, next)` - ensure the full path exists before writing to it\n-   `appendFile(path, data, options?, next)` - ensure the full path exists before writing to it\n-   `mkdir(path, mode?, next)` - mode defaults to `0o777 \u0026 (~process.umask())`\n-   `unlink(path, next)` - checks if the file exists before removing it\n\nSafeFS also define these additional methods:\n\n-   `ensurePath(path, options, next)` - ensure the full path exists, equivalent to unix's `mdir -p path`\n-   `getParentPathSync(path)` - returns the parent directory of the path\n\n## Alternatives\n\nYou should use these instead, which use and provide modern APIs while providing brilliant ecosystem support:\n\n-   [@bevry/fs-accessible](https://github.com/bevry/fs-accessible)\n-   [@bevry/fs-executable](https://github.com/bevry/fs-executable)\n-   [@bevry/fs-list](https://github.com/bevry/fs-list)\n-   [@bevry/fs-mkdirp](https://github.com/bevry/fs-mkdirp)\n-   [@bevry/fs-read](https://github.com/bevry/fs-read)\n-   [@bevry/fs-readable](https://github.com/bevry/fs-readable)\n-   [@bevry/fs-remove](https://github.com/bevry/fs-remove)\n-   [@bevry/fs-rmdir](https://github.com/bevry/fs-rmdir)\n-   [@bevry/fs-unlink](https://github.com/bevry/fs-unlink)\n-   [@bevry/fs-write](https://github.com/bevry/fs-write)\n-   [@bevry/fs-writable](https://github.com/bevry/fs-writable)\n\n\u003c!-- INSTALL/ --\u003e\n\n## Install\n\n### [npm](https://npmjs.com \"npm is a package manager for javascript\")\n\n-   Install: `npm install --save safefs`\n-   Import: `import * as pkg from ('safefs')`\n-   Require: `const pkg = require('safefs')`\n\n### [Editions](https://editions.bevry.me \"Editions are the best way to produce and consume packages you care about.\")\n\nThis package is published with the following editions:\n-   `safefs` aliases `safefs/source/index.js`\n-   `safefs/source/index.js` is [ESNext](https://en.wikipedia.org/wiki/ECMAScript#ES.Next \"ECMAScript Next\") source code for [Node.js](https://nodejs.org \"Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine\") 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with [Require](https://nodejs.org/dist/latest-v5.x/docs/api/modules.html \"Node/CJS Modules\") for modules\n\n### [TypeScript](https://www.typescriptlang.org/ \"TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.\")\n\nThis project provides its type information via inline [JSDoc Comments](http://usejsdoc.org \"JSDoc is an API documentation generator for JavaScript, similar to Javadoc or phpDocumentor\"). To make use of this in [TypeScript](https://www.typescriptlang.org/ \"TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.\"), set your \u003ccode\u003emaxNodeModuleJsDepth\u003c/code\u003e compiler option to `5` or thereabouts. You can accomplish this via your `tsconfig.json` file like so:\n``` json\n{\n  \"compilerOptions\": {\n    \"maxNodeModuleJsDepth\": 5\n  }\n}\n```\n\n\u003c!-- /INSTALL --\u003e\n\n\u003c!-- HISTORY/ --\u003e\n\n## History\n\n[Discover the release history by heading on over to the `HISTORY.md` file.](https://github.com/bevry/safefs/blob/HEAD/HISTORY.md#files)\n\n\u003c!-- /HISTORY --\u003e\n\n\u003c!-- BACKERS/ --\u003e\n\n## Backers\n\n### Code\n\n[Discover how to contribute via the `CONTRIBUTING.md` file.](https://github.com/bevry/safefs/blob/HEAD/CONTRIBUTING.md#files)\n\n#### Authors\n\n-   [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom.\n\n#### Maintainers\n\n-   [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom.\n\n#### Contributors\n\n-   [Benjamin Lupton](https://github.com/balupton) — [view contributions](https://github.com/bevry/safefs/commits?author=balupton \"View the GitHub contributions of Benjamin Lupton on repository bevry/safefs\")\n-   [James Gill](https://github.com/jagill) — [view contributions](https://github.com/bevry/safefs/commits?author=jagill \"View the GitHub contributions of James Gill on repository bevry/safefs\")\n-   [Kyle Robinson Young](https://github.com/shama) — [view contributions](https://github.com/bevry/safefs/commits?author=shama \"View the GitHub contributions of Kyle Robinson Young on repository bevry/safefs\")\n-   [Sean Fridman](https://github.com/sfrdmn) — [view contributions](https://github.com/bevry/safefs/commits?author=sfrdmn \"View the GitHub contributions of Sean Fridman on repository bevry/safefs\")\n\n### Finances\n\n\u003cspan class=\"badge-githubsponsors\"\u003e\u003ca href=\"https://github.com/sponsors/balupton\" title=\"Donate to this project using GitHub Sponsors\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-donate-yellow.svg\" alt=\"GitHub Sponsors donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-thanksdev\"\u003e\u003ca href=\"https://thanks.dev/u/gh/bevry\" title=\"Donate to this project using ThanksDev\"\u003e\u003cimg src=\"https://img.shields.io/badge/thanksdev-donate-yellow.svg\" alt=\"ThanksDev donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/bevry\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-liberapay\"\u003e\u003ca href=\"https://liberapay.com/bevry\" title=\"Donate to this project using Liberapay\"\u003e\u003cimg src=\"https://img.shields.io/badge/liberapay-donate-yellow.svg\" alt=\"Liberapay donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-buymeacoffee\"\u003e\u003ca href=\"https://buymeacoffee.com/balupton\" title=\"Donate to this project using Buy Me A Coffee\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg\" alt=\"Buy Me A Coffee donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-opencollective\"\u003e\u003ca href=\"https://opencollective.com/bevry\" title=\"Donate to this project using Open Collective\"\u003e\u003cimg src=\"https://img.shields.io/badge/open%20collective-donate-yellow.svg\" alt=\"Open Collective donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-crypto\"\u003e\u003ca href=\"https://bevry.me/crypto\" title=\"Donate to this project using Cryptocurrency\"\u003e\u003cimg src=\"https://img.shields.io/badge/crypto-donate-yellow.svg\" alt=\"crypto donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n#### Sponsors\n\n-   [Andrew Nesbitt](https://nesbitt.io) — Software engineer and researcher\n-   [Balsa](https://balsa.com) — We're Balsa, and we're building tools for builders.\n-   [Codecov](https://codecov.io) — Empower developers with tools to improve code quality and testing.\n-   [Poonacha Medappa](https://poonachamedappa.com)\n-   [Rob Morris](https://github.com/Rob-Morris)\n-   [Sentry](https://sentry.io) — Real-time crash reporting for your web apps, mobile apps, and games.\n-   [Syntax](https://syntax.fm) — Syntax Podcast\n\n#### Donors\n\n-   [Andrew Nesbitt](https://nesbitt.io)\n-   [Armen Mkrtchian](https://mogoni.dev)\n-   [Balsa](https://balsa.com)\n-   [Chad](https://opencollective.com/chad8)\n-   [Codecov](https://codecov.io)\n-   [dr.dimitru](https://veliovgroup.com)\n-   [Elliott Ditman](https://elliottditman.com)\n-   [entroniq](https://gitlab.com/entroniq)\n-   [GitHub](https://github.com/about)\n-   [Hunter Beast](https://cryptoquick.com)\n-   [Jean-Luc Geering](https://github.com/jlgeering)\n-   [Michael Duane Mooring](https://mdm.cc)\n-   [Michael Harry Scepaniak](https://michaelscepaniak.com)\n-   [Mohammed Shah](https://github.com/smashah)\n-   [Mr. Henry](https://mrhenry.be)\n-   [Nermal](https://arjunaditya.vercel.app)\n-   [Pleo](https://pleo.io)\n-   [Poonacha Medappa](https://poonachamedappa.com)\n-   [Rob Morris](https://github.com/Rob-Morris)\n-   [Robert de Forest](https://github.com/rdeforest)\n-   [Sentry](https://sentry.io)\n-   [ServieJS](https://github.com/serviejs)\n-   [Skunk Team](https://skunk.team)\n-   [Syntax](https://syntax.fm)\n-   [WriterJohnBuck](https://github.com/WriterJohnBuck)\n\n\u003c!-- /BACKERS --\u003e\n\n\u003c!-- LICENSE/ --\u003e\n\n## License\n\nUnless stated otherwise all works are:\n\n-   Copyright \u0026copy; [Benjamin Lupton](https://balupton.com)\n\nand licensed under:\n\n-   [Artistic License 2.0](http://spdx.org/licenses/Artistic-2.0.html)\n\n\u003c!-- /LICENSE --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevry%2Fsafefs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbevry%2Fsafefs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevry%2Fsafefs/lists"}