angel_file_service 2.0.1 copy "angel_file_service: ^2.0.1" to clipboard
angel_file_service: ^2.0.1 copied to clipboard

Angel service that persists data to a file on disk.

file_service #

Pub build status

Angel service that persists data to a file on disk, stored as a JSON list. It uses a simple mutex to prevent race conditions, and caches contents in memory until changes are made.

The file will be created on read/write, if it does not already exist.

This package is useful in development, as it prevents you from having to install an external database to run your server.

When running a multi-threaded server, there is no guarantee that file operations will be mutually excluded. Thus, try to only use this one a single-threaded server if possible, or one with very low load.

While not necessarily slow, this package makes no promises about performance.

Usage #

configureServer(Angel app) async {
  // Just like a normal service
  app.use(
    '/api/todos',
    new JsonFileService(
      const LocalFileSystem().file('todos_db.json')
    ),
  );
}
copied to clipboard
0
likes
40
points
54
downloads

Publisher

verified publisherangel-dart.dev

Weekly Downloads

2024.09.23 - 2025.04.07

Angel service that persists data to a file on disk.

Repository (GitHub)

License

MIT (license)

Dependencies

angel_framework, file, pool

More

Packages that depend on angel_file_service