talira

A pluggable, mockable file system abstraction for Dart

open sourceBSD-3-Clausefree

file is the Dart team's file system abstraction: a Dart-idiomatic API like dart:io's, where a file system is an object you pass around. It comes with a local file system, an in-memory one that makes code touching files easy to test, and the interfaces for implementing your own, and several file systems can be used at once. It lives in the dart-lang/tools mono-repo and is published on pub.dev by tools.dart.dev.

Problems it solves

  • test Dart code that reads and writes files without touching the real disk
  • swap the file system my Dart code uses for an in-memory fake in tests
  • implement a custom virtual file system in Dart

Features

  • In-memory file system for tests
  • Local file system with a dart:io-like API
  • Interfaces for custom file systems
  • Several file systems in one program