{"id":27113239,"url":"https://github.com/keift/trufs","last_synced_at":"2026-02-21T10:01:11.585Z","repository":{"id":275107758,"uuid":"925113168","full_name":"keift/trufs","owner":"keift","description":"Trusty file methods.","archived":false,"fork":false,"pushed_at":"2026-02-05T03:19:47.000Z","size":749,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T11:00:39.595Z","etag":null,"topics":["atomic","atomic-reads","atomic-writes","atomically","file-system","fs","fs-extra","graceful-fs"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/trufs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keift.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-31T08:56:46.000Z","updated_at":"2026-02-05T03:19:51.000Z","dependencies_parsed_at":"2025-04-01T02:25:42.168Z","dependency_job_id":"075b32c3-a86d-4a64-9283-e2f8d681dba7","html_url":"https://github.com/keift/trufs","commit_stats":null,"previous_names":["keift/fs-trusty","keift/trufs"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/keift/trufs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Ftrufs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Ftrufs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Ftrufs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Ftrufs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keift","download_url":"https://codeload.github.com/keift/trufs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Ftrufs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["atomic","atomic-reads","atomic-writes","atomically","file-system","fs","fs-extra","graceful-fs"],"created_at":"2025-04-07T02:50:13.188Z","updated_at":"2026-02-21T10:01:11.575Z","avatar_url":"https://github.com/keift.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[String]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n[Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\n[Boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n[Buffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\n[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n[Void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined\n[Null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null\n[Undefined]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined\n\n\u003c!----\u003e\n\n[ReadOptionsDefault]: https://github.com/fabiospampinato/atomically/blob/master/src/constants.ts\n[WriteOptionsDefault]: https://github.com/fabiospampinato/atomically/blob/master/src/constants.ts\n\n\u003c!----\u003e\n\n[Fs]: ./src/types/Fs.type.ts\n[ReadOptions]: ./src/types/ReadOptions.type.ts\n[WriteOptions]: ./src/types/WriteOptions.type.ts\n\n\u003cdiv align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"./assets/logo.png\" width=\"350px\"/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/trufs?label=version\u0026color=615fff\"/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/trufs?label=license\u0026color=615fff\"/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dt/trufs?label=downloads\u0026color=00bc7d\"/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/unpacked-size/trufs?label=size\u0026color=00bc7d\"/\u003e\n\u003c/div\u003e\n\n## Contents\n\n- [About](#about)\n- [Features](#features)\n- [Installation](#installation)\n- [Documentation](#documentation)\n  - [Tree](#tree)\n  - [Import](#import)\n  - [Methods](#methods)\n  - [Types](#types)\n- [Links](#links)\n  - [Discord](https://discord.gg/keift)\n  - [Telegram](https://t.me/keiftco)\n  - [Twitter](https://x.com/keiftco)\n  - [GitHub](https://github.com/keift)\n- [License](#license)\n\n## About\n\nTrusty file methods.\n\n## Features\n\n- Respects CommonJS\n- Secure with [Atomically](https://github.com/fabiospampinato/atomically)\n- Functional with [FS Extra](https://github.com/jprichardson/node-fs-extra)\n- Stable with [Graceful FS](https://github.com/isaacs/node-graceful-fs)\n\n## Installation\n\nYou can install it as follows.\n\n```shell\n# NPM\nnpm add trufs\n\n# PNPM\npnpm add trufs\n\n# Yarn\nyarn add trufs\n\n# Bun\nbun add trufs\n\n# Deno\ndeno add trufs\n```\n\n## Documentation\n\n### Tree\n\nBriefly as follows.\n\n```typescript\ntrufs\n│\n├── fs\n│   │\n│   ├── readFile(filepath, options?)\n│   ├── readFileSync(filepath, options?)\n│   ├── writeFile(filepath, data, options?)\n│   └── writeFileSync(filepath, data, options?)\n│\n├── type Fs\n├── type ReadOptions\n└── type WriteOptions\n```\n\n### Import\n\nIt is enough to change the `fs` to `trufs`.\n\n```diff\n- import fs from 'fs';\n+ import { fs } from 'trufs';\n```\n\n### Methods\n\n`fs.readFile(filepath, options?)`\n\nRead file asynchronous.\n\n\u003e | Parameter  | Type          | Default              | Description        |\n\u003e | ---------- | ------------- | -------------------- | ------------------ |\n\u003e | `filepath` | [String]      |                      | File path to read. |\n\u003e | `options?` | [ReadOptions] | [ReadOptionsDefault] | Read options.      |\n\u003e\n\u003e returns [Promise]\u003c[String] | [Buffer]\u003e\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e await fs.readFile('./config.json');\n\u003e ```\n\n\u003cbr/\u003e\n\n`fs.readFileSync(filepath, options?)`\n\nRead file synchronous.\n\n\u003e | Parameter  | Type          | Default              | Description        |\n\u003e | ---------- | ------------- | -------------------- | ------------------ |\n\u003e | `filepath` | [String]      |                      | File path to read. |\n\u003e | `options?` | [ReadOptions] | [ReadOptionsDefault] | Read options.      |\n\u003e\n\u003e returns [String] | [Buffer]\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e fs.readFileSync('./config.json');\n\u003e ```\n\n\u003cbr/\u003e\n\n`fs.writeFile(filepath, data, options?)`\n\nWrite file asynchronous.\n\n\u003e | Parameter  | Type                 | Default               | Description         |\n\u003e | ---------- | -------------------- | --------------------- | ------------------- |\n\u003e | `filepath` | [String]             |                       | File path to write. |\n\u003e | `data`     | [String] \\| [Buffer] |                       | Data to be written. |\n\u003e | `options?` | [WriteOptions]       | [WriteOptionsDefault] | Write options.      |\n\u003e\n\u003e returns [Promise]\u003c[Void]\u003e\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e await fs.writeFile('./config.json', JSON.stringify({}));\n\u003e ```\n\n\u003cbr/\u003e\n\n`fs.writeFileSync(filepath, data, options?)`\n\nWrite file synchronous.\n\n\u003e | Parameter  | Type                 | Default               | Description         |\n\u003e | ---------- | -------------------- | --------------------- | ------------------- |\n\u003e | `filepath` | [String]             |                       | File path to write. |\n\u003e | `data`     | [String] \\| [Buffer] |                       | Data to be written. |\n\u003e | `options?` | [WriteOptions]       | [WriteOptionsDefault] | Write options.      |\n\u003e\n\u003e returns [Void]\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e fs.writeFileSync('./config.json', JSON.stringify({}));\n\u003e ```\n\n### Types\n\n| Type           |\n| -------------- |\n| [Fs]           |\n| [ReadOptions]  |\n| [WriteOptions] |\n\n## Links\n\n- [Discord](https://discord.gg/keift)\n- [Telegram](https://t.me/keiftco)\n- [Twitter](https://x.com/keiftco)\n- [GitHub](https://github.com/keift)\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Keift\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeift%2Ftrufs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeift%2Ftrufs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeift%2Ftrufs/lists"}