{"id":24282712,"url":"https://github.com/lessp/fs","last_synced_at":"2025-09-09T14:21:18.696Z","repository":{"id":271257664,"uuid":"912520062","full_name":"lessp/fs","owner":"lessp","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-14T20:19:42.000Z","size":63,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T06:54:09.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lessp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-01-05T19:52:55.000Z","updated_at":"2025-01-15T13:41:00.000Z","dependencies_parsed_at":"2025-01-06T16:31:06.897Z","dependency_job_id":"15d21004-a543-49ed-9daa-cf36bf9ce8c3","html_url":"https://github.com/lessp/fs","commit_stats":null,"previous_names":["lessp/fs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lessp/fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessp%2Ffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessp%2Ffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessp%2Ffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessp%2Ffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lessp","download_url":"https://codeload.github.com/lessp/fs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessp%2Ffs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274309656,"owners_count":25261530,"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-09-09T02:00:10.223Z","response_time":80,"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":"2025-01-16T03:54:23.839Z","updated_at":"2025-09-09T14:21:18.671Z","avatar_url":"https://github.com/lessp.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e Exploratory, API subject to change. Suggestions and PRs are always welcome.\n\n# Fs\n\n`Fs` aims to expose a simple filesystem interface for OCaml.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Example](#example)\n  - [File](#file)\n    - [Create a file](#create-a-file)\n    - [Read a file](#read-a-file)\n  - [Dir](#dir)\n    - [Create a directory](#create-a-directory)\n    - [List a directory](#list-a-directory)\n- [License](#license)\n\n## Installation\n\n```sh\nopam pin fs https://github.com/lessp/fs.git\n```\n\n## Example\n\nFor a full list of examples, see the [`examples/`](./examples) directory.\n\n### File\n\n#### Create and write to a file\n\n```ocaml\nmatch Fs.File.write \"example.txt\" ~content:(String \"Hello, World!\") with\n| Ok () -\u003e print_endline \"File written!\"\n| Error e -\u003e print_endline (Fs.File.Error.to_string e)\n```\n\n```ocaml\nmatch Fs.File.append_string \"example.txt\" ~content:\"Hello, World!\" with\n| Ok () -\u003e print_endline \"File written!\"\n| Error e -\u003e print_endline (Fs.File.Error.to_string e)\n```\n\n#### Read a file\n\nAs a string:\n\n```ocaml\nmatch Fs.File.read_string \"hello.txt\" with\n| Ok content -\u003e print_endline content\n| Error e -\u003e print_endline (Fs.File.Error.to_string e)\n```\n\nUsing a custom format:\n\n```ocaml\nmatch Fs.File.read \"hello.txt\" ~format:Bytes with\n| Ok content -\u003e print_endline (Bytes.to_string content)\n| Error e -\u003e print_endline (Fs.File.Error.to_string e)\n```\n\n### Dir\n\n#### Create a directory\n\n```ocaml\nmatch Fs.Dir.create \"hello\" () with\n| Ok () -\u003e print_endline \"Directory created!\"\n| Error e -\u003e print_endline (Fs.Dir.Error.to_string e)\n```\n\n```ocaml\nmatch Fs.Dir.create \"hello/nested\" ~recursive:true () with\n| Ok () -\u003e print_endline \"Directories created!\"\n| Error e -\u003e print_endline (Fs.Dir.Error.to_string e)\n```\n\n#### List a directory\n\n```ocaml\nmatch Fs.Dir.list \"hello\" () with\n| Ok files -\u003e List.iter print_endline files\n| Error e -\u003e print_endline (Fs.Dir.Error.to_string e)\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessp%2Ffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flessp%2Ffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessp%2Ffs/lists"}