executeFromJsonFile method

Future executeFromJsonFile({
  1. required String path,
  2. String name = 'main',
  3. List<Object?>? positionalArgs,
  4. Map<String, Object?>? namedArgs,
})

Execute from a JSON file.

Convenience method that loads and parses a JSON file and executes. Supports both plain .json and gzipped .json.gz files.

Implementation

Future<dynamic> executeFromJsonFile({
  required String path,
  String name = 'main',
  List<Object?>? positionalArgs,
  Map<String, Object?>? namedArgs,
}) async {
  final ast = await parseJsonFile(path);
  return execute(
    ast: ast,
    name: name,
    positionalArgs: positionalArgs,
    namedArgs: namedArgs,
  );
}