Support running in null-safety mode

Setting the minimum SDK to 2.12 allows packages that depend on this to
migrate to null-safety.

The http package is no longer used and it hasn't been migrated yet, so I
also removed the dependency.
1 file changed
tree: 52e23bf62cd327727cca17f422cb53b141790529
  1. example/
  2. lib/
  3. tool/
  4. .gitignore
  5. CHANGELOG.md
  6. LICENSE
  7. package.json
  8. pubspec.yaml
  9. README.md
  10. yarn.lock
README.md

node_preamble.dart

A simple package for a better dart2js preamble for running on node.js. This package exists for ease of use if incorporating into your build system.

This preamble is suggested for use over d8.js, and provides many improvements and bug fixes, as it uses node.js's timer functions and event loop over the custom one implemented in d8.js.

The JavaScript file can be found at lib/preamble.js.

You can also get the preamble via Dart, like in the following example.

import "package:node_preamble/preamble.dart" as preamble;

main() {
  print(preamble.getPreamble());
}

Credit goes to the Dart team for creating Dart, dart2js, and the original preamble which this is derived from.

Contributing

The only file that we directly modify is preamble.js. After that, to reflect your changes in both preamble.dart and preamble.min.js, run npm install && npm run minify