目录

Contents

DartVM 运行环境

目录

Contents

You can use the dart tool (bin/dart) to run Dart command-line apps such as server-side scripts, programs, and servers.

Basic usage

Here’s an example of running a Dart file on the command line:

$ dart --enable-asserts test.dart

Options

Common command-line options for dart include:

--enable-asserts
Enables assert statements. When asserts are enabled, an assert statement checks a boolean condition, raising an exception if the condition is false.
--packages=<path>
Specifies the path to the package resolution configuration file. This option cannot be used with --package-root.
--version
Displays VM version information.
-h or --help
Displays help. (Add -v for information about all options.)