命令行和服务器的库和 Package
Dart SDK 包含 dart:io 和其它提供底层命令行和服务器 API 的库。
SDK 库
Dart SDK 包含 dart:io 和其它提供底层 web API 的库。
库概览的 dart:io 小节: 一个使用 dart:io 库的示例驱动概览。主要包括如何使用文件和目录以及发起和处理 HTTP 请求。
dart:io API 参考: 完整的 dart:io 库参考文档。
社区上的一些第三方 package
pub.dev 网站 暂时还不支持仅搜索命令行和服务器应用相关的 package。但是你可以搜索描述所需功能的单词。
命令行相关的 package
命令行应用常常使用下述列表中列出的 package,除此之外还有像 archive、intl 和 yaml 这样的 通用 package:
|
|
| args |
Parses raw command-line arguments into a set of options and values. |
|
|
| cli_util |
Provides utilities for building command-line apps. |
|
|
| completion |
Adds command-line completion to apps that use the args package. |
|
|
| path |
Provides comprehensive, cross-platform operations for manipulating paths. |
|
|
| usage |
Wraps Google Analytics. |
服务器相关的 package
服务器应用可选择使用的 package 更多一些,除了上面上面表格中列出的外还支持比如 logging 这样的 通用 package:
|
|
| aqueduct |
Supports building scalable REST APIs that run on the Dart VM. |
|
|
| aqueduct |
支持构建运行在 Dart VM 上可伸缩的 REST API。 |
|
|
| angel_framework |
A high-powered HTTP server with support for dependency injection & sophisticated routing. |
|
|
| crypto |
Implements cryptographic hashing functions for algorithms such as SHA-1, SHA-256, MD5, and HMAC. |
|
|
| crypto |
为 SHA-1、SHA-256、MD5 和 HMAC 等算法实现加密哈希散列函数。 |
|
|
| grpc |
Implements gRPC, a high performance, open source, general RPC framework that puts mobile and HTTP/2 first. |
|
|
| grpc |
实现 [gRPC][],将移动和 HTTP/2 放在首位的高性能开源通用的 RPC 框架。 |
|
|
| shelf |
Provides a model for web server middleware that encourages composition and easy reuse. |
|
|
| shelf |
为 Web 服务器中间件提供一个模型,该模型促成组合和易于重用。 |