{"id":26402474,"url":"https://github.com/hexojs/hexo-fs","last_synced_at":"2025-04-09T16:14:43.906Z","repository":{"id":24242816,"uuid":"27635870","full_name":"hexojs/hexo-fs","owner":"hexojs","description":"File system module for Hexo.","archived":false,"fork":false,"pushed_at":"2025-04-01T07:52:50.000Z","size":240,"stargazers_count":42,"open_issues_count":5,"forks_count":18,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-09T16:14:28.759Z","etag":null,"topics":["hexo","javascript","typescript"],"latest_commit_sha":null,"homepage":null,"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/hexojs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-06T13:54:02.000Z","updated_at":"2025-02-06T13:11:34.000Z","dependencies_parsed_at":"2023-02-17T07:46:09.005Z","dependency_job_id":"1d10cb8f-3eb4-43c8-87d2-25bc5b5f0949","html_url":"https://github.com/hexojs/hexo-fs","commit_stats":{"total_commits":187,"total_committers":21,"mean_commits":8.904761904761905,"dds":0.7700534759358288,"last_synced_commit":"9b266fe551be3684e6cd397ba13cec2c4e003a10"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexojs","download_url":"https://codeload.github.com/hexojs/hexo-fs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065282,"owners_count":21041872,"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":["hexo","javascript","typescript"],"created_at":"2025-03-17T15:18:57.588Z","updated_at":"2025-04-09T16:14:43.891Z","avatar_url":"https://github.com/hexojs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hexo-fs\n\n[![CI](https://github.com/hexojs/hexo-fs/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/hexojs/hexo-fs/actions/workflows/ci.yml)\n[![NPM version](https://badge.fury.io/js/hexo-fs.svg)](https://www.npmjs.com/package/hexo-fs)\n[![Coverage Status](https://coveralls.io/repos/github/hexojs/hexo-fs/badge.svg)](https://coveralls.io/github/hexojs/hexo-fs)\n\nFile system module for [Hexo].\n\n## Features\n\n- Support for both Promise and callback interface.\n- Use [graceful-fs] to avoid EMFILE error and various improvements.\n- Use [chokidar] for consistent file watching.\n\n## Installation\n\n``` bash\n$ npm install hexo-fs --save\n```\n\n## Usage\n\n``` js\nconst fs = require('hexo-fs');\n```\n\n\u003e Some methods in the original fs module are not listed below, but they're available in hexo-fs.\n\n### exists(path)\n\nTest whether or not the given `path` exists by checking with the file system.\n\n### existsSync(path)\n\nSynchronous version of `fs.exists`.\n\n### mkdirs(path)\n\nCreates a directory and its parent directories if they does not exist.\n\n### mkdirsSync(path)\n\nSynchronous version of `fs.mkdirs`.\n\n### writeFile(path, data, [options])\n\nWrites data to a file.\n\nOption | Description | Default\n--- | --- | ---\n`encoding` | File encoding | utf8\n`mode` | Mode | 438 (0666 in octal)\n`flag` | Flag | w\n\n### writeFileSync(path, data, [options])\n\nSynchronous version of `fs.writeFile`.\n\n### appendFile(path, data, [options])\n\nAppends data to a file.\n\nOption | Description | Default\n--- | --- | ---\n`encoding` | File encoding | utf8\n`mode` | Mode | 438 (0666 in octal)\n`flag` | Flag | w\n\n### appendFileSync(path, data, [options])\n\nSynchronous version of `fs.appendFile`.\n\n### copyFile(src, dest, [callback])\n\nCopies a file from `src` to `dest`.\n\n### copyDir(src, dest, [options])\n\nCopies a directory from `src` to `dest`. It returns an array of copied files.\n\nOption | Description | Default\n--- | --- | ---\n`ignoreHidden` | Ignore hidden files | true\n`ignorePattern` | Ignore files which pass the regular expression |\n\n### listDir(path, [options])\n\nLists files in a directory.\n\nOption | Description | Default\n--- | --- | ---\n`ignoreHidden` | Ignore hidden files | true\n`ignorePattern` | Ignore files which pass the regular expression |\n\n### listDirSync(path, [options])\n\nSynchronous version of `fs.listDir`.\n\n### readFile(path, [options])\n\nReads the entire contents of a file.\n\nOption | Description | Default\n--- | --- | ---\n`encoding` | File encoding | utf8\n`flag` | Flag | r\n`escape` | Escape UTF BOM and line ending in the content | true\n\n### readFileSync(path, [options])\n\nSynchronous version of `fs.readFile`.\n\n### emptyDir(path, [options])\n\nDeletes all files in a directory. It returns an array of deleted files.\n\nOption | Description | Default\n--- | --- | ---\n`ignoreHidden` | Ignore hidden files | true\n`ignorePattern` | Ignore files which pass the regular expression |\n`exclude` | Ignore files in the array |\n\n### emptyDirSync(path, [options])\n\nSynchronous version of `fs.emptyDir`.\n\n### rmdir(path)\n\nRemoves a directory and all files in it.\n\n### rmdirSync(path)\n\nSynchronous version of `fs.rmdir`.\n\n### watch(path, [options])\n\nWatches changes of a file or a directory.\n\nSee [Chokidar API](https://github.com/paulmillr/chokidar#api) for more info.\n\n### ensurePath(path)\n\nEnsures the given path is available to use or appends a number to the path.\n\n### ensurePathSync(path)\n\nSynchronous version of `fs.ensurePath`.\n\n### ensureWriteStream(path, [options])\n\nCreates the parent directories if they does not exist and returns a writable stream.\n\n### ensureWriteStreamSync(path, [options])\n\nSynchronous version of `fs.ensureWriteStream`.\n\n## License\n\nMIT\n\n[graceful-fs]: https://github.com/isaacs/node-graceful-fs\n[Hexo]: https://hexo.io/\n[chokidar]: https://github.com/paulmillr/chokidar","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexojs%2Fhexo-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexojs%2Fhexo-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexojs%2Fhexo-fs/lists"}