localstoragefs 0.1.0

web-based replacement for std::fs using localStorage
Documentation
  • Coverage
  • 0%
    0 out of 5 items documented0 out of 3 items with examples
  • Size
  • Source code size: 16.93 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 419.66 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 47s Average build duration of successful builds.
  • all releases: 47s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • iceiix/localstoragefs
    9 1 4
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iceiix

localstoragefs

Web-based replacement for std::fs using localStorage

Intended as a drop-in replacement when building for wasm32-unknown-unknown for HTML5. Example of supporting both native and web with the same API using cfg-if:

cfg_if! {
    if #[cfg(target_arch = "wasm32")] {
        use localstoragefs::fs;
    } else {
        use std::fs;
    }
}

then use fs::File as usual. Not all functionality is supported (contributions welcome), but at least minimal usage should work. See examples/hello for a complete example.

Inspired by Emscripten's file system support (Rust target wasm32-unknown-emscripten), but not as complete. Files are stored as local storage string values with hex-encoded data. May not be as efficient as alternatives.