node_interop 2.1.0 copy "node_interop: ^2.1.0" to clipboard
node_interop: ^2.1.0 copied to clipboard

Platformweb

Provides Dart bindings and utility functions for core Node.js modules.

example/main.dart

// Copyright (c) 2018, Anatoly Pulyaevskiy. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'dart:convert';

import 'package:node_interop/fs.dart';
import 'package:node_interop/node.dart';

/// Simple example of reading contents of current working directory and
/// printing out as nicely indented JSON.
void main() {
  final contents = List<String>.from(fs.readdirSync(process.cwd()));
  final json = JsonEncoder.withIndent('  ');
  print(json.convert(contents));
}
48
likes
125
points
243k
downloads

Publisher

unverified uploader

Weekly Downloads

Provides Dart bindings and utility functions for core Node.js modules.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

js

More

Packages that depend on node_interop