lemon_js 0.2.0 copy "lemon_js: ^0.2.0" to clipboard
lemon_js: ^0.2.0 copied to clipboard

QuickJS JavaScript engine for Flutter — cross-platform FFI and WebAssembly.

example/main.dart

import 'package:lemon_js/lemon_js.dart';

/// Runs a minimal QuickJS evaluation and prints the converted Dart value.
Future<void> main() async {
  final engine = await JsEngine.create();
  try {
    final result = await engine.eval('''
      const values = [1, 2, 3];
      ({ total: values.reduce((sum, value) => sum + value, 0) });
    ''');
    // ignore: avoid_print
    print(result);
  } finally {
    await engine.dispose();
  }
}
0
likes
0
points
241
downloads

Publisher

unverified uploader

Weekly Downloads

QuickJS JavaScript engine for Flutter — cross-platform FFI and WebAssembly.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

archive, crypto, ffi, flutter, flutter_web_plugins, http, shared_preferences, web

More

Packages that depend on lemon_js

Packages that implement lemon_js