node_interop
2.2.0, released 2 years ago by an unverified publisher
Dart bindings for Node.js core modules
What it does
Provides JavaScript bindings and utility functions for core Node.js modules, allowing Dart code to call Node APIs directly. It supports null‑safe Dart and exposes each Node module as a Dart library.
AI-written summary of version 2.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building Dart applications that run on Node.js
- Need direct access to Node core APIs from Dart
- Migrating existing Node code to Dart
Skip it when
- Targeting only web browsers or Flutter mobile apps
- Using only high‑level Dart packages that abstract Node I/O
Strengths
- Zero‑copy interop via js package
- Null‑safe API surface
- Comprehensive coverage of many core modules
Weaknesses
- Not all Node modules are bound (e.g., cluster, readline)
- Requires Node runtime to run
- No high‑level abstractions for async patterns
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add dependency to pubspec and import the desired module, e.g., import 'package:node_interop/os.dart';
import 'package:node_interop/node.dart';
void main() {
print("Hello world, I'm currently in ${process.cwd()}." );
}Alternatives
Packages that do the same job and could replace node_interop.
- sodium
Dart bindings for the libsodium cryptographic library for Dart-VM and Web.
85Compare - gtk
GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.
76Compare - syncfusion_flutter_core
Core dependency for Syncfusion Flutter widgets, providing shared functionality.
90Compare - async
Utility classes and helpers that extend Dart's async library.
83Compare
Works with
Packages commonly used together with node_interop: ones it builds on, ones built on it, and its own family.