dart_spawner 1.1.0 copy "dart_spawner: ^1.1.0" to clipboard
dart_spawner: ^1.1.0 copied to clipboard

Runs a Dart script/File/Uri inside a new Isolate of the current Dart VM. It also can spawn a Dart File from another Dart project/package into the current Dart VM.

example/dart_spawner_example.dart

import 'package:dart_spawner/dart_spawner.dart';

void main() async {
  var spawner = DartSpawner(logToConsole: true);

  var script = r'''
    void main(List<String> args) {
      print('From Script! Args: $args');
    }
  ''';

  print('Spawning Script: <<<\n\n$script\n>>>');

  var spawned = await spawner.spawnDart(script, ['a', 'b', 'c']);

  print('Spawned: $spawned');

  var exitCode = await spawned.exitCode;
  print('Exit code: $exitCode');
}
12
likes
140
pub points
70%
popularity

Publisher

unverified uploader

Runs a Dart script/File/Uri inside a new Isolate of the current Dart VM. It also can spawn a Dart File from another Dart project/package into the current Dart VM.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

async_extension, path, yaml

More

Packages that depend on dart_spawner