directory_structure_map 1.0.1 copy "directory_structure_map: ^1.0.1" to clipboard
directory_structure_map: ^1.0.1 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:

-- 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>'
  }
}