directory_structure_map 2.0.0 copy "directory_structure_map: ^2.0.0" to clipboard
directory_structure_map: ^2.0.0 copied to clipboard

Converts the contents of a directory to JSON.

pub package Build Status

Converts the contents of a directory to JSON.

Usage #

Suppose a directory structure like this:

-- a.txt
-- emptyDir
-- subDir
  -- b.txt
import 'package:directory_structure_map/directory_structure_map.dart';

void main() async {
  var map = await directoryToMap('./directoryPath');
  print(map);
}

Prints:

{
  'emptyDir': {},
  'a.txt': '<File contents in hex>',
  'subDir': {
    'b.txt': '<File contents in hex>'
  }
}

Options #

  • filter: only entries returned true in filter are processed
  • noFileContents: when true, files have a null value instead of a hex string
0
likes
130
pub points
6%
popularity

Publisher

verified publisherflutter-cavalry.com

Converts the contents of a directory to JSON.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

convert, path

More

Packages that depend on directory_structure_map