Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/osakitsukiko/scroll
A simple runtime indexed archive library + tool written in zig
https://github.com/osakitsukiko/scroll
Last synced: about 1 month ago
JSON representation
A simple runtime indexed archive library + tool written in zig
- Host: GitHub
- URL: https://github.com/osakitsukiko/scroll
- Owner: OsakiTsukiko
- License: mit
- Created: 2024-11-14T17:04:21.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-14T17:41:13.000Z (about 1 month ago)
- Last Synced: 2024-11-14T18:25:03.907Z (about 1 month ago)
- Language: Zig
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Scroll - A RUNTIME INDEXED ARCHIVE
(tool and library)## What is Scroll
Scroll is a tool + library duo for creating archives and then accessing them at runtime and extracting data by the data index (relative path).
Using the tool `scroll` you can easily create an archive file `sroll ` and then using `libscroll` you can access that
data and extract it (as bytes) by the index (relative path). For more information look at the test cases inside `src/lib.zig`.## Why is Scroll
My main reason behind **Scroll** is using it alongside **WebUI** for shipping binaries. No one likes having to ship their binary alongside a folder
full of .html and .js files. For now it only works by providing a `fs.File` but I am working on a version that works directly with bytes as well for
languages that support direct file import (like zig's `@embeedFile`). Also more works is needed to get the library to work well with other languages,
for now only supporting zig.## Instalation:
For ZIG version `0.13.0`
Run the following command in the **root folder** of your zig project:
```bash
zig fetch --save https://github.com/OsakiTsukiko/scroll/archive/main.tar.gz
```
and then add the following to you `build.zig` file:
```zig
pub fn build(b: *std.Build) void {
// ...
const scroll_dependency = b.dependency("scroll", .{});
const exe = b.addExecutable(.{
// ...
});
exe.root_module.addImport("scroll", scroll_dependency.module("scroll"));
// ...
}
```
now you can use scroll inside your source files:
```zig
const RuntimeArchive = @import("scroll").RuntimeArchive;
```