{"id":15497481,"url":"https://github.com/heapwolf/cxx-fs","last_synced_at":"2025-12-17T03:02:25.718Z","repository":{"id":20498710,"uuid":"23777117","full_name":"heapwolf/cxx-fs","owner":"heapwolf","description":"Provides a nodejs-like experience for file I/O in C++ using c++1y and libuv.","archived":false,"fork":false,"pushed_at":"2015-03-31T20:55:20.000Z","size":946,"stargazers_count":17,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-24T00:46:19.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/heapwolf.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":"2014-09-08T02:36:51.000Z","updated_at":"2019-04-10T12:16:13.000Z","dependencies_parsed_at":"2022-09-09T09:22:53.856Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/cxx-fs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heapwolf/cxx-fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcxx-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcxx-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcxx-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcxx-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/cxx-fs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcxx-fs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27775891,"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","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-02T08:38:27.939Z","updated_at":"2025-12-17T03:02:25.680Z","avatar_url":"https://github.com/heapwolf.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nA friendly, nodejs-like file i/o experience for C++\n\n# USAGE\n\n```cpp\n#include \"../fs.h\"\n\nusing namespace std;\nusing namespace nodeuv;\n\nint main() {\n \n  Filesystem fs;\n\n  fs.readFile(\"test.txt\", [](auto err, auto data) {\n\n    if (err) {\n      cout \u003c\u003c err.message \u003c\u003c endl;\n      return;\n    }\n\n    cout \u003c\u003c data \u003c\u003c endl;\n  });\n}\n```\n\n# Filesystem\n\n## CONSTRUCTOR\n### Filesystem fs;\nCreates a loop for file operations.\n\n## INSTANCE METHODS\n\n### `string` fs.cwd();\nReturns a string that represents the current working directory.\n\n### `string` fs.readFile(string path, Callback cb);\nStats, Opens, reads whole file, callback provides (`error`, `streambuf`).\n\n### `Buffer` fs.readFileSync(string path);\nStats, Opens, reads whole file and returns an instance of `Buffer`.\n\n### `void` fs.writeFile(string path, Buffer buf, Callback cb);\nOpens, writes whole buffer, callback provides (`error`).\n\n### `Buffer` fs.writeFileSync(string path, Buffer buf);\nOpens, writes whole value from the instance of `Buffer`.\n\n### `void` fs.stat(string path, Callback cb);\nCallback provides (`error`, `stats`), where stats is a struct containing \nthe following members...\n\n### `Stats` fs.statSync(string path);\nReturns a Stats struct.\n\n```cpp\nuint64_t dev;\nuint64_t mode;\nuint64_t nlink;\nuint64_t uid;\nuint64_t gid;\nuint64_t rdev;\nuint64_t ino;\nuint64_t size;\nuint64_t blksize;\nuint64_t blocks;\nuint64_t flags;\nuint64_t gen;\nuv_timespec_t atime;\nuv_timespec_t mtime;\nuv_timespec_t ctime;\nuv_timespec_t birthtime;\n```\n\n### `Error` fs.mkdirSync(string path, [int mode]);\nCreate a directory sync, optionally pass the mode as an octal. Returns\nan error instance that will have the value of null if the operation was\nsuccessful.\n\n### `Error` fs.rmdirSync(string path);\nRemove a direcory sync. Returns an error object that has the value of\nnull if the operation was a success.\n\n### `void` fs.open(string path, Callback cb);\nThe callback provides two arguments `Error` which will be null if the\noperation was a success and a file descriptor.\n\n### `int` fs.openSync(string path, [int mode]);\nOpen a file sync, optionally pass the mode as an octal. Returns the\nfile descriptor.\n\n### `void` fs.read(int fd, int bufferSize, int offset, Callback cb);\nCallback provides (`error`, `uv_buf_t`).\n\n### `Buffer` fs.readSync(int fd, int bufferSize, int offset);\nReturns an instance of `Buffer`.\n\n### `void` fs.write(int fd, Buffer buf, int offset, Callback cb);\nCallback provides (`error`, `uv_buf_t`).\n\n### `int` fs.writeSync(int fd, Buffer buf, int offset, int length);\nWrite an instance of `Buffer` to a file, returns the number of bytes\nwritten.\n\n### `void` fs.close(fd, callback);\nClose a file. Callback provides an instance of `Error` which is null\nif the operation was a success.\n\n### `Error` fs.closeSync(fd);\nClose a file sync.\n\n# Buffers\nA little sugar on top of `uv_buf_t`. This should get moved out to\nanother module called `nodeuv-buffer`.\n\n## CONSTRUCTOR\n### Buffer buf(string);\n### Buffer buf();\n### Buffer buf(size);\n\n## INSTANCE METHODS\n### buf.toString();\n### `void` buf.copy(Buffer targetBuf[, int targetStart][, int sourceStart][, int sourceEnd]);\n\n## STATIC MEMBERS\n### buf.data\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fcxx-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fcxx-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fcxx-fs/lists"}