{"id":16369707,"url":"https://github.com/dcsunset/transformfs","last_synced_at":"2025-10-26T07:31:09.045Z","repository":{"id":244673276,"uuid":"815928630","full_name":"DCsunset/transformfs","owner":"DCsunset","description":"A read-only FUSE filesystem to transform input files to output files with Lua script.","archived":false,"fork":false,"pushed_at":"2024-11-19T17:22:33.000Z","size":74,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T16:52:52.851Z","etag":null,"topics":["file","filesystem","fs","fuse","rust","transform"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCsunset.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-06-16T15:01:02.000Z","updated_at":"2024-12-23T23:00:19.000Z","dependencies_parsed_at":"2024-06-16T17:16:25.101Z","dependency_job_id":"16fc96b8-0c14-4084-be86-693f2f4d10a6","html_url":"https://github.com/DCsunset/transformfs","commit_stats":null,"previous_names":["dcsunset/transformfs"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Ftransformfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Ftransformfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Ftransformfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Ftransformfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCsunset","download_url":"https://codeload.github.com/DCsunset/transformfs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238284795,"owners_count":19446729,"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":["file","filesystem","fs","fuse","rust","transform"],"created_at":"2024-10-11T02:56:05.402Z","updated_at":"2025-10-26T07:31:03.757Z","avatar_url":"https://github.com/DCsunset.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# transformfs\n\n[![Crates.io Version](https://img.shields.io/crates/v/transformfs)](https://crates.io/crates/transformfs)\n\nA read-only FUSE filesystem to transform input files to output files with Lua script.\n\nIn transformfs, the input files can be transformed on demand by the user-defined Lua script.\nThe inputs are a list of files passed to the user script,\nand the user script returns a list of files to generate dynamically.\n\nThis filesystem is useful to transform data without duplicating or modifying the original files.\n\n## Installation\n\n### Cargo\n\n```shell\ncargo install transformfs\n```\n\n### Nix\n\nTransformfs is also packaged as an NUR package `nur.repos.dcsunset.transformfs`.\nYou can install it by including it in your nix config.\n\n\n## Usage\n\n``` shell\n# mount transformfs\ntransformfs -s \u003clua_script\u003e [-i \u003cinput1\u003e...] \u003cmnt_point\u003e\n\n# umount\nfusermount -u \u003cmnt_point\u003e\n```\n\nThe inputs can be zero, one, or multiple files or directories (directories are resolved to individual files).\n\nThe user Lua script must return a module (table) with the following functions as its fields:\n- `transform(inputs)`: Function to transform inputs (a list of file paths) to outputs. It should return a list of `Output`.\n\nEach `Output` is table with the following fields:\n- `path`: Path of the file (parent directories are auto created if path contains them)\n- `metadata`: Return the metadata of the file as `FileMetadata`.\n- `open()`: (optional) Called when opening a file if defined. Useful to open the file in advance for performance\n- `close()`: (optional) Called when closing a file if defined. Useful to reclaim resources\n- `read(offset, size)`: Return the content of the file as string at a specific position.\n\n`FileMetadata` fields:\n- `size`: Size of the file\n- `block_size`: (optional) Block size of the file (default: 512)\n\n\nTransformfs uses LuaJIT for performance reason as Lua code is executed very frequently for large files.\nThus it may not support new features in Lua 5.3 or 5.4 at the time of writing.\n\nSee example scripts in `examples` directory for more details and `transformfs --help`.\nThe examples in this repo include:\n- `static.lua`: Replace the content of all input files to static content\n- `concat.lua`: Concatenate all inputs to an output file\n- `line_number.lua`: Append a line number to every line in each file\n- `filter.lua`: Filter input files by filenames using a pattern\n\n\n## License\n\nAGPL-3.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Ftransformfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcsunset%2Ftransformfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Ftransformfs/lists"}