nodejs_interop 0.6.0 nodejs_interop: ^0.6.0 copied to clipboard
Provides interoperability with Node.js APIs.
Node.js Interop for Dart #
This package provides Node.js interoperability for Dart.
Requirements #
If you plan to play with the sources, you will also need the latest Grinder version.
Installing via Pub #
1. Depend on it #
Add this to your package's pubspec.yaml
file:
dependencies:
nodejs_interop: *
2. Install it #
Install this package and its dependencies from a command prompt:
$ pub get
3. Import it #
Now in your Dart code, you can use:
import 'dart:js';
import 'package:nodejs_interop/nodejs_interop.dart';
Usage #
Unit tests #
In order to run the tests, you must install the Node.js test dependencies by running the following command:
$ NODE_ENV=development npm install
Then, you must tell the test runtime where are located the newly installed npm packages by setting the NODE_PATH
environment variable to the path of the local node_modules
folder:
$ export NODE_PATH="$PWD/node_modules"
Finally, you can launch the test runner from the command prompt:
$ pub run test
See also #
License #
Node.js Interop for Dart is distributed under the MIT License.