jsonstreamreader 0.0.7 jsonstreamreader: ^0.0.7 copied to clipboard
This project is processes a local json file by splitting it into smaller chunks, with automatic garbage collecting.Please use latest version.
import 'dart:io';
import 'package:jsonstreamreader/jsonstreamreader.dart';
import 'package:path_provider/path_provider.dart';
void main() {
Stopwatch stopwatch = new Stopwatch()..start();
getApplicationDocumentsDirectory().then((Directory path) {
File file = new File(path.path + '/mcfdcasesincaredemographics.json');
Streamer s = new Streamer(file, chunksize: 1000);
//now you can add delays between each chunck
Reader r = new Reader(s, delay: 10);
r.filter("\$.*", (dynamic value, String key) {
print("value is ${value} and key is ${key}");
}).done(() {
print('executed in ${stopwatch.elapsed}');
}).fail((err) {
print(err);
});
}).catchError((error) {
print(error);
});
//runApp(MyApp());
}